gpt4 book ai didi

java - 来自 Maven 依赖项的 Maven 版本插件 : reference a rule. xml?

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:21:12 24 4
gpt4 key购买 nike

我正在使用 mvn versions:display-dependency-updates versions:display-plugin-updates 目标来检查依赖项或插件更新。

我的 maven 项目是一个多模块项目,它看起来像这样:

moduleA
|- moduleB1
| |- moduleC
|- moduleB2
|- build-config/rules.xml

由于有一些不需要的更新,比如我不想要的测试版,我制作了一个过滤器(有效)。我是这样使用它的:

<profile>
<id>maven-version-plugin-1</id>
<activation>
<property>
<name>version.rules.uri</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<configuration>
<rulesUri>${version.rules.uri}</rulesUri>
</configuration>
</plugin>
</plugins>
</build>
</profile>

我被迫使用配置文件和属性 version.rules.uri 因为它必须引用现有文件(默认情况下它指向 ./build-config/rules. xml,但它也在我的 settings.xml 中,具有绝对路径)。

我想通过以下方式避免这种情况:

  • 发布一个独立的build-config项目
  • 使用一些 uri 引用此项目:m2:myGroupId:myArtifactId:version:scope:jar/rules.xml

现在的问题是:是否有 Maven Wagon 插件的实现(由 maven 版本插件使用)允许读取存储库条目,例如 jar ?

最佳答案

这对我有用:

<rulesUri>file:///${session.executionRootDirectory}/maven-version-rules.xml</rulesUri>

变量${session.executionRootDirectory}的含义见 Finding the root directory of a multi module maven reactor project .

关于java - 来自 Maven 依赖项的 Maven 版本插件 : reference a rule. xml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26120704/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com