Karo La Karo La - 4 months ago 23
Java Question

How to pass parameters to maven build using pom.xml?

I wanted pass maven command line parameter to POM.xml so that i can use those value for some other purpose in building purpose.

Answer

If we have parameter like below in our POM XML

<version>${project.version}.${svn.version}</version>
  <packaging>war</packaging>

I run maven command line as follows :

mvn clean install package -Dproject.version=10 -Dsvn.version=1
Comments