第谷复制依赖项不包括插件依赖项



对于我的第谷反应堆中的一个插件,我想在名为"lib/"的文件夹中复制一个"纯maven"依赖项及其传递依赖项。

目前,如果我使用maven-dependency-plugin中的copy-dependencies目标,我的依赖项被正确复制,但第 谷解析的"插件依赖项"也被复制,我不想要这些。

有什么建议可以实现这一目标吗?我目前正在使用以下代码片段

<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
</dependencies> 
<build>
<plugins>
<plugin>
<groupId>${maven.groupid}</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-resources</phase> 
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer> 
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

欢迎任何建议。

在 Eclipse 论坛上进行讨论之后,我们似乎可以告诉 maven 只包含来自当前pom.xml文件的依赖项,使用excludeScopeincludeScope标签的组合。

此更新的 XML 代码段按预期完成工作

<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
</dependencies> 
<build>
<plugins>
<plugin>
<groupId>${maven.groupid}</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-resources</phase> 
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer> 
<!-- The lines below are aimed at telling maven NOT TO COPY tycho dependencies. Do not remove those! -->
<!-- See: https://dev.eclipse.org/mhonarc/lists/tycho-user/msg05080.html -->
<excludeScope>system</excludeScope>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

最新更新