这是我在 StackOverflow 中的第二个问题。第一个有点长。我希望这次我能切入正题:)
假设 Eclipse 插件项目 P 通过 Require-Bundle 依赖于插件 R。所以我们的 Eclipse 工作区中有 2 个项目。
同样,Eclipse 插件项目 P 依赖于通过 Bundle-Classpath 的常规 A.jar。
最后,A.jar 位于带有 POM 的 maven 存储库中,并且依赖于 B.jar。
我需要将 A.jar 和 B.jar 复制到 P 的本地 lib 文件夹,而不是 R.jar。
在 POM 文件中,P 和 R 的 GroupId 是 G。A 和 B 的 GroupId 不同,但不是 G。
我不明白为什么,但是复制依赖的目标是搜索 R.jar,当它找不到它并且不复制 A.jar 或 B.jar 时失败。我尝试使用 excludeGroupIds 但无法成功:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<excludeGroupIds>G</excludeGroupIds>
<outputDirectory>lib</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<stripVersion>true</stripVersion>
</configuration>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>validate</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<dependencies>
<dependency>
<groupId>X</groupId>
<artifactId>A</artifactId>
<version>SNAPSHOT</version>
</dependency>
</dependencies>
有没有办法排除 eclipse-plugin 依赖项?