Maven 3.1.0 版本依赖于 Eclipse Aether (org.eclipse.aether) 而不是 Sonatype Aether (org.sonatype.aether)。这似乎破坏了依赖于 Sonatype aether 的插件的兼容性:尝试运行此类插件,您将遇到:
java.lang.NoClassDefFoundError: org/sonatype/aether/*
Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.*
如https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound中所述
现在,是否可以使用 Maven 3.0.x 和 Maven 3.1.x使依赖于以太类(例如 org.sonatype.aether.RepositorySystemSession)的 mojo 运行?
还是我必须发布同一个插件的两个版本,一个用于 3.0.x ,一个用于 3.1.x ?像这样制定执法者规则:
<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>
我已经在 Maven 开发者邮件列表上发布了这个问题,但到目前为止还没有答案......