The 3.1.0 release of Maven relies on Eclipse Aether (org.eclipse.aether) instead of Sonatype Aether (org.sonatype.aether). This seems to break compatibility for plugins relying on Sonatype aether : try running such plugins and you'll run into :
java.lang.NoClassDefFoundError: org/sonatype/aether/*
Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.*
As documented in https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound
Now, is it possible to make a mojo relying on aether classes (such as org.sonatype.aether.RepositorySystemSession) run both with Maven 3.0.x and Maven 3.1.x ?
Or do I have to release two versions of the same plugin, one for 3.0.x and one for 3.1.x ? Putting enforcer rules like this :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.0,3.1)</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
I already posted the question on Maven developers mailing list, but no answer so far...
Well, Aether is the answer. It's an easily embeddable Java library to work with artifact repositories, enabling you to fetch artifacts from remote repositories for local consumption and to publish local artifacts to remote repositories for sharing with others.
Mojo interface, which the Mojo must implement (or else extend its abstract base class counterpart org. apache. maven.
What is a Mojo? A mojo is a Maven plain Old Java Object. Each mojo is an executable goal in Maven, and a plugin is a distribution of one or more related mojos.
Maven 3 aims at supporting a stricter separation between the compile/runtime/test dependencies of a project and the plugins used to build the project. For this reason, build extensions, plugins and plugin dependencies are no longer resolved from the <repositories> of a project but only from its <pluginRepositories> .
Most of these plugins depend on the Maven Dependency Tree, which is capable to collect the right set of dependencies no matter the Maven Version. Version 2.1 was released to support Eclipse Aether next to Sonatype Aether If your plugin can use this component, you should be save.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With