Much existing, legacy Maven plugin code uses org.sonatype.aether to interact with (download, upload, query) Maven repositories such as the central repository.
Some plugin use this for tests, especially integration tests, but not in the plugin itself.
This page describes how to convert that old code to the current APIs from Maven resolver.
The oldest dependencies have the group ID org.sonatype.aether.
Old dependencies have the group ID org.eclipse.aether.
The up to date code lives in org.apache.maven.resolver.
To be specific:
org.sonatype.aether:aether-connector-file → org.apache.maven.resolver:maven-resolver-transport-file
org.sonatype.aether:aether-connector-wagon → org.apache.maven.resolver:maven-resolver-transport-wagon
When migration is complete, no pom.xml should import a dependency with the group ID org.sonatype.aether or org.eclipse.aether
Web searches will uncover a lot of outdated, buggy documentation based on org.sonatype.aether and org.eclipse.aether. In particular ignore all documentation on eclipse.org.
Old code lives in the org.sonatype.aether package. When you're done no references to this package should remain.
New code lives in the org.eclipse.aether package. This includes code that comes from org.apache.maven.resolver. That is, in the newest code the group ID does not match the Java package name.
You cannot simply rename packages in the Java source code. Subpackages have also been renamed or moved and classes have been renamed or deleted as well.
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-file</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-wagon</artifactId>
<scope>test</scope>
</dependency>
You would add<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
org.sonatype.aether
.You may also want to use visual panels to communicate related information, tips or things users need to be aware of. |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|