简体   繁体   English

在多个ServiceMix POM中更新Maven依赖版本

[英]Update Maven dependency version in multiple ServiceMix POMs

I am trying to automate process of changing version of a product that has ServiceMix (FuseESB) as an integration module. 我正在尝试自动化更改具有ServiceMix(FuseESB)作为集成模块的产品版本的过程。

Changing the version in each POM is quite easy with the Maven versions plugin: 使用Maven版本插件,在每个POM中更改版本非常容易:

mvn versions:set -DnewVersion=NEW_VERSION -DgenerateBackupPoms=false

However, I am now struggling with updating version in dependencies that are other modules of this product. 但是,我现在正在努力更新作为该产品其他模块的依赖项中的版本。 Particularly, in many Service Units' POM files there are dependencies like these (where OLD_VERSION is the same, older version number): 特别是,在许多服务单元的POM文件中,存在类似以下的依赖项(其中OLD_VERSION是相同的,较旧的版本号):

<dependencies>
  <dependency>
    <groupId>com.company.department.product.module1</groupId>
    <artifactId>artifact1</artifactId>
    <version>OLD_VERSION</version>
  </dependency>
  <dependency>
    <groupId>com.company.department.product.module1</groupId>
    <artifactId>artifact2</artifactId>
    <version>OLD_VERSION</version>
  </dependency>
  <dependency>
    <groupId>com.company.department.product.module2</groupId>
    <artifactId>artifact3</artifactId>
    <version>OLD_VERSION</version>
  </dependency>
</dependencies>

And I would like to set the version number in those dependencies to "NEW_VERSION". 我想将这些依赖项中的版本号设置为“ NEW_VERSION”。

Do you guys have any ideas? 你们有什么主意吗?

刚刚发现了一个非常简单的解决方案-用$ {project.version}替换依赖项的版本-对我有用,因为在我的项目中,依赖项与项目本身具有相同的版本(它们都是同一产品的工件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM