maven - Tycho 复制依赖不包括插件依赖
问题描述
对于我的第谷反应器中的一个插件,我想在名为“lib/”的文件夹中复制一个“纯 maven”依赖项及其传递依赖项。
目前,如果我使用copy-dependencies
来自 的目标maven-dependency-plugin
,我的依赖项会被正确复制,但由 tycho 解析的“插件依赖项”也会被复制,我不想要这些。
有什么建议可以实现这个目标吗?我目前正在使用以下代码片段
<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
文件的依赖项。excludeScope
includeScope
这个更新的 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>
推荐阅读
- r - 使用 groupby 和填充的 R 条件变异日期列
- postgresql - 基于两个数据库的 Springboot Batch-REST-app 的 Docker 问题
- laravel - 使用 git-codecommit 拒绝 aws 权限(公钥)
- javascript - 如何从 .NET 的 BinaryWriter 序列化的四个字节中读取单精度浮点数
- c++ - 如何在 C++ 中为偶数位置做可变参数模板?
- python - 使用多处理时避免重新编译 numba 代码
- javascript - Uncaught SyntaxError: Unexpected identifier (当我通过 Uncaught SyntaxError 在我的 add 函数中传递一个对象作为参数时)
- r - 如何将所有 coef(model) 参数放在 r 中的一个数据帧中
- java - 无限 ImageViews 的垃圾收集问题
- python - PYTHON WTForms 烧瓶 - 将数据从下拉列表保存到数据库