jcabi / jcabi-aether

Wrapper of Sonatype Aether
http://aether.jcabi.com/
Other
64 stars 33 forks source link

Exception in thread "main" org.sonatype.aether.resolution.DependencyResolutionException: failed to load 'org.dbunit:dbunit:jar:2.5.0 (runtime)' from ["maven-central (http://repo1.maven.org/maven2/, releases+snapshots) without authentication"] into repo #65

Open siegfried01 opened 9 years ago

siegfried01 commented 9 years ago

I found this code at http://stackoverflow.com/questions/11799923/programmatically-resolving-maven-dependencies-outside-of-a-plugin-get-reposito

This sample code works for some projects but not other.

I tried using a more recent version but this did not help:

    <dependency>
      <groupId>com.jcabi</groupId>
      <artifactId>jcabi-aether</artifactId>
      <version>0.10.1 </version><!--0.7.19 -->
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.0.3</version>
    </dependency>

Looks like there is a logic error with regard to security/authentication:

Exception in thread "main" org.sonatype.aether.resolution.DependencyResolutionException: failed to load 'org.dbunit:dbunit:jar:2.5.0 (runtime)' from ["maven-central (http://repo1.maven.org/maven2/, releases+snapshots) without authentication"] into C:\Users\siegfried\.m2\repository
    at com.jcabi.aether.Aether.fetch(Aether.java:188)
    at com.jcabi.aether.Aether.resolve_aroundBody2(Aether.java:153)
    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:191)
    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:125)
    at com.jcabi.aether.Aether.resolve(Aether.java:150)
    at com.jcabi.aether.Aether.resolve_aroundBody0(Aether.java:136)
    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:191)
    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:125)
    at com.jcabi.aether.Aether.resolve(Aether.java:129)
    at com.test.mavenaether.MavenAether.getClasspathFromMavenProject(MavenAether.java:81)
    at com.test.mavenaether.MavenAether.main(MavenAether.java:54)
Caused by: java.lang.IllegalArgumentException: failed to load 'org.dbunit:dbunit:jar:2.5.0 (runtime)' from ["maven-central (http://repo1.maven.org/maven2/, releases+snapshots) without authentication"] into C:\Users\siegfried\.m2\repository
    ... 17 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in maven-central (http://repo1.maven.org/maven2/)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
    at com.jcabi.aether.Aether.fetch(Aether.java:179)
    ... 16 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in maven-central (http://repo1.maven.org/maven2/)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
    ... 17 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in maven-central (http://repo1.maven.org/maven2/)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1542)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1537)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector$GetTask.flush(AsyncRepositoryConnector.java:1035)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector.get(AsyncRepositoryConnector.java:409)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:457)
    ... 19 more

Compilation exited abnormally with code 1 at Tue Sep 01 10:44:09
dmarkov commented 9 years ago

@yegor256 please do something about this issue

yegor256 commented 9 years ago

@siegfried01 are you sure artifact com.oracle:ojdbc14:jar:10.2.0.4.0 exists in Maven Central?