9

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 开发者邮件列表上发布了这个问题,但到目前为止还没有答案......

4

1 回答 1

2

这些插件中的大多数依赖于Maven 依赖树,无论 Maven 版本如何,它都能收集正确的依赖集。版本 2.1 已发布以支持 Sonatype Aether 旁边的 Eclipse Aether 如果您的插件可以使用此组件,则应该保存。

于 2013-07-16T20:36:41.683 回答