Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching artifacts from https://jitpack.io is broken #106

Open
mirceanis opened this issue Mar 7, 2020 · 2 comments
Open

Fetching artifacts from https://jitpack.io is broken #106

mirceanis opened this issue Mar 7, 2020 · 2 comments

Comments

@mirceanis
Copy link

I'm trying to fetch some artifacts from https://jitpack.io
I used the example code on https://aether.jcabi.com/ and replaced the repository and artifact coordinates like so:

import com.jcabi.aether.Aether;

import java.io.File;
import java.util.Arrays;
import java.util.Collection;

import org.sonatype.aether.artifact.Artifact;
import org.sonatype.aether.repository.RemoteRepository;
import org.sonatype.aether.resolution.DependencyResolutionException;
import org.sonatype.aether.util.artifact.DefaultArtifact;

public class Main {
    public static void main(String[] args) throws DependencyResolutionException {
        File local = new File("/tmp/local-repository");
        Collection<RemoteRepository> remotes = Arrays.asList(
                new RemoteRepository("jitpack", "default", "https://jitpack.io"),
                new RemoteRepository("jcenter", "default", "https://jcenter.bintray.com/")
        );
        Collection<Artifact> deps = new Aether(remotes, local).resolve(
                new DefaultArtifact("com.github.uport-project:kmnid:0.4.2"),
                "runtime"
        );
    }
}

This code fails with the following exception:

Exception in thread "main" org.sonatype.aether.resolution.DependencyResolutionException: failed to load 'com.github.uport-project:kmnid:jar:0.4.2 (runtime)' from ["jitpack (https://jitpack.io, releases+snapshots) without authentication"] into /tmp/local-repository
	at com.jcabi.aether.Aether.fetch(Aether.java:237)
	at com.jcabi.aether.Aether.resolve_aroundBody2(Aether.java:180)
	at com.jcabi.aether.Aether$AjcClosure3.run(Aether.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrap(MethodLogger.java:208)
	at com.jcabi.aspects.aj.MethodLogger.ajc$inlineAccessMethod$com_jcabi_aspects_aj_MethodLogger$com_jcabi_aspects_aj_MethodLogger$wrap(MethodLogger.java:1)
	at com.jcabi.aspects.aj.MethodLogger.wrapClass(MethodLogger.java:136)
	at com.jcabi.aether.Aether.resolve(Aether.java:177)
	at com.jcabi.aether.Aether.resolve_aroundBody0(Aether.java:163)
	at com.jcabi.aether.Aether$AjcClosure1.run(Aether.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrap(MethodLogger.java:208)
	at com.jcabi.aspects.aj.MethodLogger.ajc$inlineAccessMethod$com_jcabi_aspects_aj_MethodLogger$com_jcabi_aspects_aj_MethodLogger$wrap(MethodLogger.java:1)
	at com.jcabi.aspects.aj.MethodLogger.wrapClass(MethodLogger.java:136)
	at com.jcabi.aether.Aether.resolve(Aether.java:156)
	at Main.main(Main.java:20)
Caused by: java.lang.IllegalArgumentException: failed to load 'com.github.uport-project:kmnid:jar:0.4.2 (runtime)' from ["jitpack (https://jitpack.io, releases+snapshots) without authentication"] into /tmp/local-repository
	... 16 more
Caused by: java.lang.NullPointerException
	at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:352)
	at com.jcabi.aether.Aether.fetch(Aether.java:228)
	... 15 more

It seems to point to Aether.fetch() which leads to a dead end as it indicates a bug in the sonatype dependency which is unmaintained.

Please indicate any possible workaround you may think of or any hint of a fix.

@0crat
Copy link

0crat commented Mar 7, 2020

@yegor256/z please, pay attention to this issue

@JDFind
Copy link

JDFind commented Mar 7, 2020

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants