I am in reference to "Maven: The Complete Reference" and especially the section regarding profiles which documents the use of a <properties...
tag within the <profile...
tag here: see here
<profile>
<id>development</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>environment.type</name>
<value>dev</value>
</property>
</activation>
<properties>
<database.driverClassName>com.mysql.jdbc.Driver</database.driverClassName>
<database.url>
jdbc:mysql://localhost:3306/app_dev
</database.url>
<database.user>development_user</database.user>
<database.password>development_password</database.password>
</properties>
</profile>
What I am not sure about is what happens when the mvn install -Denvironment.type=dev
command is run:
- Will this create a
.properties
file? - If not how and where will tomcat (for instance) read the individual properties when the app is tested in dev?