简体   繁体   中英

Release Individual Modules Using Maven Release Plugin

I have a project Structure like below

P1 |trunk |branches |tags

P2 |trunk |branches |tags

P3 |trunk |branches |tags

p1 is an individual jar project. P2 is also a jar project but dependant on p1 and p3 requires both p1 and p2. P3 is basically a war file that has both p1 and p2 in it.

Till now i was trying to use a parent pom with these projects added as child modules and trying to perform a version upgrade, tag and release.Each of these projects inherit the parent pom However i see that the tagging is failing for individual projects.

So my question is

is it possible for me to use release plugin to upgrade the version and perform a tag update to individual projects like this?. If not possible what is the best way to perform an automated release for an individual project structure like this?.

These are legacy code and the branches folder has a lot of branches checked in there. can't easily re factor it to plain parent - child model in maven.

Thanks in Advance

This should be possible. Could you show the relevant parts of your pom.xml and describe why the tagging is failing? And by the way, this is Subversion, right?

I would try with a POM structure like this. Parent:

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>...</groupId>
    <artifactId>parent</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>
    <modules>
        <module>../child1/</module>
        <module>../child2/</module>
    </modules>
</project>

Child:

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>...</groupId>
        <artifactId>parent</artifactId>
        <version>1.0</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>
    <groupId>...</groupId>
    <artifactId>child-1</artifactId>
    <version>1.1</version>
    ...
</project>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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