Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is maven release skipping my child modules

What I am trying to do is to push out a couple of parent poms for all of our sub projects. I have a single project that contains a single parent pom with two child module poms. Packaging for all three are of type pom if this makes a difference. When I deploy though it is failing to deploy the child modules saying that they are skipped.

Parent Pom

    <groupId>com.test.cpbx</groupId>
    <artifactId>parent</artifactId>
    <packaging>pom</packaging>
    <version>1.1-SNAPSHOT</version>
    <name>Parent Pom</name>


    <scm>
            <connection>scm:svn:https://url/trunk</connection>
    </scm>

    <modules>
            <module>appia</module>
            <module>rialto</module>
    </modules>

    <build>
            <plugins>
                    <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-release-plugin</artifactId>
                            <configuration>
                                    <goals>deploy</goals>
                                    <providerImplementations>
                                            <svn>javasvn</svn>
                                    </providerImplementations>
                            </configuration>
                            <dependencies>
                                    <dependency>
                                            <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
                                            <artifactId>maven-scm-provider-svnjava</artifactId>
                                            <version>2.0.5</version>
                                            <scope>compile</scope>
                                    </dependency>
                            </dependencies>
                    </plugin>
            </plugins>
    </build>

    <dependencies>
            <dependency>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                    <version>4.11</version>
            </dependency>
    </dependencies>

This is one of my child poms, they are the same with the only change being the artifactId name

Child POM

<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>com.test.cpbx</groupId>
                <artifactId>parent</artifactId>
                <version>1.1-SNAPSHOT</version>
        </parent>

        <artifactId>rialto-parent</artifactId>
        <packaging>pom</packaging>
        <name>Rialto Parent POM</name>

</project>

Output

mvn  -B -DreleaseVersion=1.1 -DdevelopmentVersion=1.2.0-SNAPSHOT   release:prepare -DdryRun 

...
[INFO] Not removing release POMs
[INFO] Executing completion goals - since this is simulation mode it is running against the original project, not the rewritten ones
[INFO] Full run would be commit 3 files with message: '[maven-release-plugin] prepare for next development iteration'
[INFO] Release preparation simulation complete.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Parent Pom ........................................ SUCCESS [2.573s]
[INFO] Appia Parent POM .................................. SKIPPED
[INFO] Rialto Parent POM ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.749s
[INFO] Finished at: Wed May 21 14:52:30 CDT 2014
[INFO] Final Memory: 15M/114M
[INFO] ------------------------------------------------------------------------
like image 944
Chris Hinshaw Avatar asked May 21 '14 19:05

Chris Hinshaw


People also ask

What does Maven release do?

The main aim of the maven-release plugin is to provide a standard mechanism to release project artifacts outside the immediate development team. The plugin provides basic functionality to create a release and to update the project's SCM accordingly.

Can two Maven modules depend on each other?

Because modules within a multi-module build can depend on each other, it is important that the reactor sorts all the projects in a way that guarantees any project is built before it is required. The following relationships are honoured when sorting projects: a project dependency on another module in the build.

How do I release a project in Maven?

perform some checks – there should be no uncommitted changes and the project should depend on no SNAPSHOT dependencies. change the version of the project in the pom file to a full release number (remove SNAPSHOT suffix) – in our example – 0.1. run the project test suites. commit and push the changes.

How do I skip a Maven build module?

Maven version 3.2. 1 added this feature, you can use the -pl switch (shortcut for --projects list) with ! or - (source) to exclude certain submodules. Be careful in bash the character ! is a special character, so you either have to single quote it (like I did) or escape it with the backslash character.


2 Answers

There was some confusion with the output of maven.

The output does not mean it is skipping building the modules or deploying the modules.

It is a message about the refactoring of the versions. The output is telling us that the parent pom owns the version and the child versions are dependent on the parent pom. This means that it does not need to refactor the child modules pom.xml so it prints the child in the reactor summary as SKIPPED.

like image 75
Chris Hinshaw Avatar answered Oct 06 '22 05:10

Chris Hinshaw


Another possibility is that it mean that the process did not worked until being able to build those modules:

In case of an activated parallel execution it can show something like this: [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Parent Pom ........................................ SUCCESS [2.573s] [INFO] Child1 POM ........................................ SKIPPED [INFO] Child2 POM ........................................ SKIPPED [INFO] Dependent Sibling POM ............................. FAILURE [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------

If one of the Childx artifacts is needed by the dependent sibling, it can be requesting the dependency before this even was built. This causes the whole build to fail.

It is just misleading to think the last was only failed because the other were missed during build. An ABORTED state in the overview would have saved some time.

like image 28
Marvin Emil Brach Avatar answered Oct 06 '22 04:10

Marvin Emil Brach