java - Maven - 从另一个插件中排除插件
问题描述
我有一个需要在构建中使用的插件。然而,这个插件在构建时依赖于另一个插件,并且这种依赖在Java-8 之后不起作用。
具体来说,我想使用的插件在它的 pom.xml 文件中有这个
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${javaVersion}</version>
<scope>system</scope>
<systemPath>${tools.jar}</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<phase>test-compile</phase>
......
</execution>
</executions>
</plugin>
它设置为test-compile
阶段,因此它仅在构建插件本身时运行,而不是在使用时运行。
问题是它systemPath
作为依赖项的一部分被设置为使用 Java 9+ 无法解决的问题。这反过来会导致使用插件的项目构建失败:
[ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} @
所以要么我需要完全忽略maven-antrun-plugin
作为我使用这个插件的一部分,要么我至少需要让它的依赖项工作。
有什么想法吗?
干杯
解决方案
推荐阅读
- python - 如何将某些行转换为相同的索引 - Python
- reactjs - 我应该如何删除警告“React Hook useEffect 缺少依赖项”?
- asp.net-mvc - 为什么此视图上的脚本不会运行
- java - 识别用于创建 AudioRecord 的一组有效参数
- delphi - 在 RAD Studio 中使用 ClientDataSets 的 2 个 TCombobox 父子关系的实时绑定表达式
- linear-regression - 为什么在 SPSS 多元回归中删除了一个自变量?
- php - 如何在使用 laravel 从数据库中获取数据时附加图像路径
- sql - 将多个查询合并为一个查询以加快速度
- c++ - 可变参数模板。可变参数模板数据结构中模板参数列表的大小
- ruby-on-rails - 在 Rails ActiveRecord 迁移中,`using:` 关键字