|
@@ -100,9 +100,40 @@
|
|
|
<version>1.2.33</version>
|
|
|
</dependency>
|
|
|
</dependencies>
|
|
|
+
|
|
|
+ <!-- maven多环境打包配置 -->
|
|
|
+ <profiles>
|
|
|
+ <!-- 开发环境 -->
|
|
|
+ <profile>
|
|
|
+ <id>dev</id>
|
|
|
+ <properties>
|
|
|
+ <spring.profiles.active>dev</spring.profiles.active>
|
|
|
+ </properties>
|
|
|
+ <!-- 设置为默认环境 -->
|
|
|
+ <activation>
|
|
|
+ <activeByDefault>true</activeByDefault>
|
|
|
+ </activation>
|
|
|
+ </profile>
|
|
|
+ <!-- 生产环境 -->
|
|
|
+ <profile>
|
|
|
+ <id>prod</id>
|
|
|
+ <properties>
|
|
|
+ <spring.profiles.active>prod</spring.profiles.active>
|
|
|
+ </properties>
|
|
|
+ </profile>
|
|
|
+ <!-- 测试环境 -->
|
|
|
+ <profile>
|
|
|
+ <id>test</id>
|
|
|
+ <properties>
|
|
|
+ <spring.profiles.active>test</spring.profiles.active>
|
|
|
+ </properties>
|
|
|
+ </profile>
|
|
|
+ </profiles>
|
|
|
+
|
|
|
<!--添加maven插件,项目的打包工具,打成jar包,否则在打包运行时报错 -->
|
|
|
<build>
|
|
|
- <finalName>CIS</finalName>
|
|
|
+ <!-- 打包名格式:项目名-环境-打包时间.jar -->
|
|
|
+ <finalName>${project.artifactId}-${spring.profiles.active}</finalName>
|
|
|
<resources>
|
|
|
<resource>
|
|
|
<directory>src/main/java</directory>
|
|
@@ -119,6 +150,7 @@
|
|
|
<include>**/*.yml</include>
|
|
|
<include>**/*.properties</include>
|
|
|
</includes>
|
|
|
+ <filtering>true</filtering>
|
|
|
</resource>
|
|
|
</resources>
|
|
|
<plugins>
|
|
@@ -141,6 +173,14 @@
|
|
|
</execution>
|
|
|
</executions>
|
|
|
</plugin>
|
|
|
+ <!-- maven 打包时跳过测试 -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-surefire-plugin</artifactId>
|
|
|
+ <configuration>
|
|
|
+ <skipTests>true</skipTests>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
</plugins>
|
|
|
</build>
|
|
|
</project>
|