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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:53:32+00:00 2026-06-15T09:53:32+00:00

I have a pom file in which version numbers of some dependencies rely on

  • 0

I have a pom file in which version numbers of some dependencies rely on the project version property specified in the settings of the pom file. Can I overwrite this via the command-line? If so, how?

Here’s the long story:

We are currently transitioning our projects to maven, but we’re not all the way there yet. There are multiple modules that are still not built with maven and are therefore dependencies in our project (they are built into jars through ant). Upon release, we want all of these jars to be built and contain the same version number as the parent project. For a release, two steps are performed (until we can get everything using maven)

  1. The jars are built in ant with the correct release version (12.12.4.0).
  2. The maven release plugin is used to deploy the project to our artifact repository.

In the second step command-line arguments are used to specify the release:

mvn release:prepare -DreleaseVersion=12.12.4.0 -DdevelopmentVersion=12.12.4.1-SNAPSHOT -Dtag=iv-12.12.4.0

I would like the pom file to be updated with the version specified. However, when this command is run, the version within the pom file (12.12.4.0-SNAPSHOT) is still being used. This fails the “checking dependencies and plugins for snapshots” step and I am required to resolve my jars that still have the 12.12.4.0-SNAPSHOT version used from the maven version property.

This led me to the original question of how I can override this so that the version resolves to that specified on the command line.
Additional questions that could get me past this is:
How to allow the maven release plugin to update the pom file before this check?
How to skip the snapshot check (not desirable)

I could create a property within the pom file that I can overwrite, but then I’d have to maintain the version number in two places within the pom file.

Thoughts?

  • 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-15T09:53:33+00:00Added an answer on June 15, 2026 at 9:53 am

    Put parameters directly to pom from command line for example:

    mvn clean install -Dtestng.version=6.3.1

    Example:

         <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>com.test</groupId>
            <artifactId>test</artifactId>
            <version>1.0.0</version>
            <name>test</name>
            <properties>
                    <testng.version>6.4</testng.version>
            </properties>
    
            <dependencies>
                    <dependency>
                            <groupId>org.testng</groupId>
                            <artifactId>testng</artifactId>
                            <version>${testng.version}</version>
                            <scope>test</scope>
                    </dependency>
            </dependencies>
    </project>
    

    If you run it normally testng version 6.4 will be used. But if you run it like: mvn clean install -Dtestng.version=6.3.1 testng version 6.3.1 will be used.

    See Setting Maven params in Jenkins

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

Sidebar

Related Questions

I have project A which a pom.xml dependency of: <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.2</version> </dependency>
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
I have a pom file which is generating source from WSDL files which is
I have the following in my project's pom.xml which I think should display the
i have a parent pom file that include 3 module... and there is difference
I have a maven pom.xml file with multiple instances of a same goal defined
I have a super pom defined in which I specify a "resources" directory for
I'm looking for applications that have rich maven pom(s) and can show lot of
I have a Grails project with pom.xml that is treated as Maven project by
Is there a way to specify the artifact version outside of the POM file?

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.