If I have 2 maven profiles for a WAR application like this:
mvn clean install -Pdevelopment
mvn clean install -Pproduction
and I import it in Eclipse to run in Tomcat, how to I tell Tomcat to use one profile or the other?
Right-click the maven project, click Run As —> Run Configurations menu item. Input clean install tomcat7:deploy in the Goals input text box deploy maven project to tomcat. Click Run button, when you see BUILD SUCCESS in the output console, that means the maven deploy to tomcat server process complete successfully.
Profiles are specified in pom. xml file using its activeProfiles/profiles elements and are triggered in variety of ways.
A profile in Maven is an alternative set of configuration values which set or override default values. Using a profile, you can customize a build for different environments.
You can activate the maven profile
at the Eclipse
by using the following step: -
Right click
at your project and select properties
.Properties windows
select Maven
.right hand panel
you will see Active Maven Profiles
text box.profile name
, e.g. development
or production
.I hope this may help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With