Skip to content
Advertisement

How to set different version based on profile maven

I have a java project with mvn I need to have different version based on the mvn profile

JavaScript

How do I set version.profile based on the profile ?

Advertisement

Answer

you can create profiles like below

JavaScript

then your default profile is demo1, and version is 1.0.0 you can use variables in profile in your maven

JavaScript

if you want to build with version 2.0.0 just run maven with mvn -Pdemo2 package also you can use multiple parameter like mvn -Pdemo2,example2 package

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement