Maven profiles and Spring profiles
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<log4j.level>DEBUG</log4j.level>
<spring.profiles.active>dev</spring.profiles.active>
<!-- hibernate -->
<hibernate.hbm2ddl.auto>create</hibernate.hbm2ddl.auto>
<hibernate.show_sql>true</hibernate.show_sql>
<hibernate.format_sql>true</hibernate.format_sql>
<!-- mail config -->
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources-dev</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
<profile>
<id>staging</id>
<properties>
<jdbc.url><![CDATA[jdbc:mysql://localhost:3306/app]]>
</jdbc.url>
<jdbc.username>root</jdbc.username>
<jdbc.password></jdbc.password>
<log4j.level>INFO</log4j.level>
<spring.profiles.active>staging</spring.profiles.active>
<hibernate.hbm2ddl.auto>update</hibernate.hbm2ddl.auto>
<hibernate.show_sql>false</hibernate.show_sql>
<hibernate.format_sql>false</hibernate.format_sql>
<hibernate.dialect>org.hibernate.dialect.MySQL5Dialect</hibernate.dialect>
</properties>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources-staging</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
<profile>
<id>prod</id>
<properties>
<log4j.level>INFO</log4j.level>
<spring.profiles.active>prod</spring.profiles.active>
<hibernate.hbm2ddl.auto>none</hibernate.hbm2ddl.auto>
<hibernate.show_sql>false</hibernate.show_sql>
<hibernate.format_sql>false</hibernate.format_sql>
<hibernate.dialect>org.hibernate.dialect.MySQL5Dialect</hibernate.dialect>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources-prod</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
</profiles>Last updated