maven override project.version from command line -


i wonder if possible override project.version/version variable in maven via command line?

the following doesn't work:

mvn deploy -dversion=1.0-test-snapshot   mvn deploy -dproject.version=1.0-test-snapshot   

thanks in advance help!

my pom.xml is:

<project>     <modelversion>4.0.0</modelversion>     <groupid>just.another.company.name</groupid>     <artifactid>my-pom</artifactid>     <version>1.3-snapshot</version>     <name>my module</name>     <packaging>jar</packaging>     <description>pom project module</description> </project> 

simply can't override project.version. try:

mvn versions:set -dnewversion=<version> 

usually, start updating parentpom

mvn versions:set -dnewversion=1.0.3-snapshot 

this enough if parent pom contained child projects if not need go super project contain child project , execute

mvn versions:update-child-modules 

also 2 previous steps enough if parentpom exists in relative path if not need install parentpom project new version

mvn install 

usually enough if don't have module depend on module. if do, declare version project.version , reflected automatically

<version>${project.version}</version> 

check maven versions plugin docs.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -