Maven更新POM和所有与更改的POM有依赖关系的POM

时间:2016-12-22 15:49:28

标签: maven maven-plugin maven-release-plugin

我有一个具有以下结构的项目。

_groupedItems

在服务内部我有多个maven项目,如下所示:

D:\PROJECT\Services

我想更新DTO项目的POM版本。

D:\PROJECT\Services\DTO
D:\PROJECT\Services\PERSON
...

如果我执行此行:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>com.hijat2</groupId>
    <artifactId>Hijat2-root-parent</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>
<artifactId>hijat2-dto</artifactId>
<version>0.6.0-EPIC-6312-SNAPSHOT</version>
<name>hijat2-dto</name>
<description>Data transfer object library for P.</description>
<dependencies>
    <dependency>
        <groupId>com.hijat2</groupId>
        <artifactId>hijat2-enum</artifactId>
        <version>0.6.0-EPIC-6312-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
        </plugin>
    </plugins>
</build>

这将改变:

mvn versions:set -DnewVersion=$RELEASE_VERSION -DautoVersionSubmodules=true

我的问题是,如何将具有此POM文件的所有POM文件更新为依赖文件?

就像这个项目的例子一样

...
<parent>
<groupId>com.hijat2</groupId>
<artifactId>Hijat2-root-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>hijat2-dto</artifactId>
<version>NEW VERSION</version>
<name>hijat2-dto</name>
...

这是具有DTO依赖性的POM

D:\PROJECT\Services\PERSON

两个文件都在不同的文件夹中,这可以吗?

提前致谢。

0 个答案:

没有答案
相关问题