Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8560167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:12:58+00:00 2026-06-11T16:12:58+00:00

I have parent pom with modules defined like so : parent pom.xml <?xml version=1.0

  • 0

I have parent pom with modules defined like so :

parent pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    <modelVersion>4.0.0</modelVersion>
    <groupId>parent</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.2-SNAPSHOT</version>
    <packaging>pom</packaging>
    <modules>
        <module>../proj1</module>
        <module>../proj2</module>
    </modules>

</project>

Here are the child module pom files :

proj2 pom.xml

<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>parent</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.2-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

    <groupId>proj2</groupId>
    <artifactId>proj2</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
</project>

proj1 pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmln: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>parent</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.2-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

    <groupId>proj1</groupId>
    <artifactId>proj1</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
</project>

But when I use the versions plugin it just sets the parent version number and not its modules.
Here is the command I am using :

versions:set -DnewVersion=1.0.2-SNAPSHOT

Here is the output :

[INFO] proj1 ...................................... SKIPPED
[INFO] proj2 ...................................... SKIPPED
[INFO] parent ......................................SUCCESS

The sub modules are being skipped. How can I enable the sub modules to be also updated and not just the parent?

Update : ive tried deleting the version tag from the child module so child module now is :

<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>parent</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.2-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

  <groupId>proj2</groupId>
  <artifactId>proj2</artifactId>
  <packaging>war</packaging>
</project>    


<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>parent</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.2-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

  <groupId>proj1</groupId>
  <artifactId>proj1</artifactId>
    <packaging>war</packaging>
</project>   

But version number is not being updated in child pom files.

Update : Here is how I think this process works, please feel free to suggest revisions :

Theoritically (I havent tested this) in a nested file structure Maven will update the individual version numbers for each child module when the goal : ‘ons:set -DnewVersion=1.0.2-SNAPSHOT’ is run.

However in a flat file structure it is not required to specify the version number in the child modules if the parent module has the same version. This is because the child version number if not set will use the parent version number. So to update all of the child modules of a parent module just update the version numer of the parent module, if all of the child modules do not have version number set then they will have same version number as parent module.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:13:00+00:00Added an answer on June 11, 2026 at 4:13 pm

    Ok, now if your child modules are referencing the parent pom, you can delete the version tag from the child module poms, so they the version will get inherited from the parent pom.

    Since the version gets inherited from the pom, when you use the version plugin, all the the modules will have the same version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the multi module project this is the parent pom. <?xml version=1.0 encoding=UTF-8?>
I have a pom file that looks similar to this <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
How do I run selected modules using parent pom in Maven like I have
I have parent project parent, which has three modules like: <groupId>com.dummy.bla.bla</groupId> <artifactId>parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging>
My multi-module Maven project looks like: /foo pom.xml /foo-parent /foo-core /foo-something /src /site Pay
I'm developing a maven project with several modules in eclipse. The parent pom.xml declares
Currently, I have a Maven project which inherits from a parent pom defining two
I have Maven multi-module project with such structure: parent-pom-project -- module1 -- module2 At
Currently, I have the following structure for my project Foo : foo-parent +- pom.xml
I have a project with a parent pom.xml which define profiles, and a debug

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.