Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] Upgrade project to to latest Wagon, Aether provider and API

I had a test project running these versions in an embedded version:

    <properties>
        <aetherVersion>1.12</aetherVersion>
        <mavenVersion>3.0.3</mavenVersion>
        <wagonVersion>1.0</wagonVersion>
    </properties>

I noticed Aether moved up to 1.13.1 and maven-aether-provider to 3.0.4, and the Wagon updated to 2.2.  So I moved to these version . 

    <properties>
        <aetherVersion>1.13.1</aetherVersion>
        <mavenVersion>3.0.4</mavenVersion>
        <wagonVersion>2.2</wagonVersion>
    </properties>

After this upgrade on the dependencies the project started failing when attempting wagon downloads (NullPointerException, stack trace below).

After moving the wagon back to 1.0, things worked again. So I have two questions:

1) What is the proper version of the Wagon, Api and Maven provider to use for an aether embedded (only HTTP as a wagon)?

2) When I moved to 3.04 and 1.13.1 I have the following code with a deprecated:

  private static RepositorySystem newRepositorySystem() {
    DefaultServiceLocator locator = new DefaultServiceLocator(); // <--- Deprecated
    if (isOnline) {
      locator.setServices(WagonProvider.class, new ManualWagonProvider());
      locator.addService(RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class);
    }
    return locator.getService(RepositorySystem.class);
  }

How do I do this behavior on the new API? 


Thomas


Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.slf4j:slf4j-api:pom:1.5.11 from/to ex nebula (http://www.exnebula.org/files/repo/): NullPointerException
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.openConnectionInternal(LightweightHttpWagon.java:277)
at org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:105)
at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:207)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.connectWagon(WagonRepositoryConnector.java:345)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.pollWagon(WagonRepositoryConnector.java:385)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:571)


Back to the top