1

I have the following situation:

masterpom.xml:

...
<modules>
  <module>sample-module</module>
</modules>
...
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <version>2.1</version>
    <inherited>true</inherited>
    <executions>
        <execution>
            <id>update-parent</id>
            <phase>pre-clean</phase>
            <goals>
                <goal>update-parent</goal>
            </goals>
            <configuration>
                <parentVersion>4.4.2.1</parentVersion>
            </configuration>
        </execution>
    </executions>
</plugin>
...

I would like to execute the versions-maven-plugin's update-parent goal on every module listed between <modules> and </modules>.
How can I do that? This configuration that I already tried doesn't work, because the modules do not inherit from masterpom.xml (they have a different parent which shouldn't be modified).

I also tried running the plugin from the command line:

mvn versions:update-parent "-DparentVersion=[4.4.2.1]"

but the changes will not be limited to the modules I want.

EDIT: running the plugin from the command line at the appropriate location seems to work. I still don't know how to produce the same effect by specifying options inside the POM.

0x5C91
  • 3,360
  • 3
  • 31
  • 46

0 Answers0