英文:
Maven how to always use the LATEST release of a depdenecy in CI/CD
问题
对于我们的项目,我们依赖于另一个内部库,而这个库发布非常频繁。
在父应用程序中,我们希望始终使用这个依赖项的最新版本。
使用Maven 3.x,我在pom文件中执行了以下操作:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<configuration>
<includes>
<include>abc.def.xyz:exmaple-dep</include>
</includes>
</configuration>
</plugin>
但是当我使用Maven来获取最新版本时,它获取了所有依赖项的最新版本。
我使用以下命令测试了这种行为:
mvn versions:display-dependency-updates -Dincludes=abc.def.xyz:exmaple-dep
解决方案是让versions-maven-plugin仅获取给定依赖项的最新版本。
英文:
For our project, we have a dependency on another internal library and this library has very very frequent releases.
In the parent application, we want to always use the latest version of this dependency.
With Maven 3.x, I did the following in the pom file
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<configuration>
<includes>
<include>abc.def.xyz:exmaple-dep</include>
</includes>
</configuration>
</plugin>
But when I use the maven to fetch the latest versions, it is fetching latest versions of all dependencies.
I tested this behaviour with the below command:
mvn versions:display-dependency-updates -Dincludes=abc.def.xyz:exmaple-dep
What would be the solution that versions-maven-plugin fetches the latest version only of the given dependency.
答案1
得分: 1
目标 versions:display-dependency-updates
没有 include
参数,但 versions:use-latest-versions
有。
如果语法无效,请使用代替的语法 abc.def.xyz:exmaple-dep:*:*:*
。
英文:
The goal versions:display-dependency-updates
does not have an include parameter, but versions:use-latest-versions
has.
If the syntax does not work, use abc.def.xyz:exmaple-dep:*:*:*
instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论