我有一个Maven插件,它在其配置中采用了groupId,artifactId和version.
我希望能够从远程存储库下载该工件并将该文件复制到项目中.我无法弄清楚如何下载工件.
我知道我可以使用依赖插件解决依赖关系,但我需要它在我的插件中发生.我怎样才能做到这一点?
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.*
Run Code Online (Sandbox Code Playgroud)
如https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound中所述
现在,是否有可能依赖于以太类(例如org.sonatype.aether.RepositorySystemSession)与Maven 3.0.x和Maven 3.1.x一起运行?
或者我是否必须发布同一插件的两个版本,一个用于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>
Run Code Online (Sandbox Code Playgroud)
我已经在Maven开发者邮件列表上发布了这个问题,但到目前为止还没有答案......