maven 插件用于打不同环境的版本包


  <!-- 用于打不同环境的版本包 -->

  <profiles>

  <!-- dev环境 -->

  <profile>

  <id>dev</id>

  <build>

  <filters>

  <filter>log4j.dev.properties</filter>

  <filter>params.dev.properties</filter>

  </filters>

  <resources>

  <resource>

  <directory>src/main/resources</directory>

  <includes>

  <include>log4j.properties</include>

  <include>params.properties</include>

  <include>dictionary.properties</include>

  </includes>

  <filtering>true</filtering>

  </resource>

  <resource>

  <directory>src/main/resources</directory>

  <excludes>

  <exclude>log4j.properties</exclude>

  <exclude>params.properties</exclude>

  </excludes>

  <filtering>false</filtering>

  </resource>

  </resources>

  </build>

  <activation>

  <activeByDefault>true</activeByDefault>

  <property>

  <name>env</name>

  <value>dev</value>

  </property>

  </activation>

  </profile>

 

  <!-- pro环境 -->

  <profile>

  <id>pro</id>

  <build>

  <filters>

  <filter>log4j.pro.properties</filter>

  <filter>params.pro.properties</filter>

  </filters>

  <resources>

  <resource>

  <directory>src/main/resources</directory>

  <includes>

  <include>log4j.properties</include>

  <include>params.properties</include>

<include>dictionary.properties</include>

  </includes>

  <filtering>true</filtering>

  </resource>

  <resource>

  <directory>src/main/resources</directory>

  <excludes>

  <exclude>log4j.properties</exclude>

  <exclude>params.properties</exclude>

  </excludes>

  <filtering>false</filtering>

  </resource>

  </resources>

  </build>

  </profile>

 

  <!-- uat环境 -->

  <profile>

  <id>uat</id>

  <build>

  <filters>

  <filter>log4j.uat.properties</filter>

  <filter>params.uat.properties</filter>

  </filters>

  <resources>

  <resource>

  <directory>src/main/resources</directory>

  <includes>

  <include>log4j.properties</include>

  <include>params.properties</include>

<include>dictionary.properties</include>

  </includes>

  <filtering>true</filtering>

  </resource>

  <resource>

  <directory>src/main/resources</directory>

  <excludes>

  <exclude>log4j.properties</exclude>

  <exclude>params.properties</exclude>

  </excludes>

  <filtering>false</filtering>

  </resource>

  </resources>

  </build>

  </profile>

  </profiles>


上一篇:maven打包SpringBoot项目部署,分离依赖jar包和静态资源


下一篇:iOS 手动crash