maven多环境打war包,指定war不带版本号

时间:2021-08-03 21:49:36
<build>  
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*.*</include>
<include>**/*.*</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- compiler插件, 设定JDK版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<showWarnings>true</showWarnings>
</configuration>
</plugin>

<!-- war打包插件, 设定war包名称不带版本号 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.5</version>
<configuration>
<warName>${project.artifactId}</warName>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>*.*</include>
<include>**/*.*</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>

</plugins>
</build>