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 9011031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:37:13+00:00 2026-06-16T02:37:13+00:00

I have a multimodule maven project, where module share dependencies. By share I mean

  • 0

I have a multimodule maven project, where module share dependencies. By share I mean use the same dependencies. However each module declares dependencies itself. To keep sanity (yeah, maven, sanity, I know), and to have all modules using the same version of dependencies, parent pom declares properties with version numbers:

<properties>
   <dependency1.version>1.0-SNAPSHOT</dependency1.version>
   <dependency2.version>1.1-SNAPSHOT</dependency2.version>
</properties>

and all modules use that like:

<dependency>
  <groupId>group</groupId>
  <artifactId>dependency1</artifactId>
  <version>${dependency1.version}</version>
</dependency>

I’m quite happy with this setup, as it allows me to change dependencies versions in 1 place.

Now I have a bunch of dependencies that I maintain myself. Release of those is automatic and very simple, basically:

mvn release:prepare release:perform -B

now I want to automate further and in the main project I run:

mvn versions:update-properties

(basically I also run: “mvn versions:use-releases” to change usual dependencies if needed, but it’s out of the scope of this question).

After this update-properties run, properties in my main projects pom point to releases (which is good). However if my modules use properties to define versions of other dependencies and those projects have newer versions available, those properties are also changed.

Is there any way to limit damage from update-properties? versions:use-release takes includes property, so I can use it only on mine artefacts. Cannot find anything similar for update-properties.

I can revert all poms besides parent one and commit/push only that, but it doesn’t seem elegant.

  • 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-16T02:37:15+00:00Added an answer on June 16, 2026 at 2:37 am

    It sounds that you didn’t understand the concept of maven.
    In such circumstances you should use dependencyManagement in the parent pom like the following:

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>com.google.inject</groupId>
          <artifactId>guice</artifactId>
          <version>3.0</version>
        </dependency>
        ...
       </dependencies>
    </dependencyManagement>
    

    In you modules you just use a dependency like this:

      <dependencies>
        <dependency>
          <groupId>com.google.inject</groupId>
          <artifactId>guice</artifactId>
        </dependency>
        ...
       </dependencies>
    

    The important step is not to define the version. In this case the version will be used which is defined by the dependency management block. So you don’t need to define properties etc. and furthermore you have a single point where you can define and change the dependencies in particular the versions.

    Apart from that it’s possible to limit the properties which will be changed defining it on the command line on the version:update-properties call.

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

Sidebar

Related Questions

I have a multi module maven project and I would like to use versions
I use eclipse and the maven plugin. I have a big multi-module project (~6
I have a big multi-module Maven project with thousands of tests. Each test loads
I have a multi-module Maven project that makes use of WAR overlays (stack of
I have a multimodule maven project. the service module depends on domain module using
We have a multi-module Maven project who's primary artifact is a WAR. However our
I have a multimodule maven project like : Main Module Module A Module B
I have created a multi module maven project. Now I have shared the project
We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin
I am using soapUI maven plugin to create a multi-module maven-soapUi project. I have

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.