Java maven WEB-INF\WEB.xml已添加,正在跳过
当我使用mvn clean package-DskipTests时,控制台显示:Java maven WEB-INF\WEB.xml已添加,正在跳过,java,maven,Java,Maven,当我使用mvn clean package-DskipTests时,控制台显示: WEB-INF\web.xml already added, skipping 如果web.xml不引用pom中的任何参数,则这不会造成任何伤害。但是如果您有一个从maven获取参数的路径,那么这将保持字符串的原样 那么,这场web.xml复制竞赛是如何进行的呢?如何解决呢? 控制台: pom配置文件和构建: <profiles> <profile>
WEB-INF\web.xml already added, skipping
如果web.xml不引用pom中的任何参数,则这不会造成任何伤害。但是如果您有一个从maven获取参数的路径,那么这将保持字符串的原样
那么,这场web.xml复制竞赛是如何进行的呢?如何解决呢?
控制台:
pom配置文件和构建:
<profiles>
<profile>
<id>dev</id>
<properties>
<deploy.type>dev</deploy.type>
<rp.build.warname>wx-common</rp.build.warname>
<property.path>/wx-common/prod</property.path>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/${deploy.type}</directory>
<filtering>true</filtering>
<excludes>
<exclude>sms.properties</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/dev/*</exclude>
</excludes>
<includes>
<include>**/mappers/*</include>
<include>*</include>
</includes>
</resource>
</resources>
</build>
发展
发展
wx普通
/wx普通/产品
org.apache.maven.plugins
maven资源插件
2.6
复制资源
验证
复制资源
${project.build.outputDirectory}
src/main/resources/${deploy.type}
真的
sms.properties
src/main/resources
真的
**/发展/*
**/制图员/*
*
downvoter:当你投反对票时,你介意回答这个问题吗?重复:downvoter:当你投反对票时,你介意回答这个问题吗?重复:
<profiles>
<profile>
<id>dev</id>
<properties>
<deploy.type>dev</deploy.type>
<rp.build.warname>wx-common</rp.build.warname>
<property.path>/wx-common/prod</property.path>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/${deploy.type}</directory>
<filtering>true</filtering>
<excludes>
<exclude>sms.properties</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/dev/*</exclude>
</excludes>
<includes>
<include>**/mappers/*</include>
<include>*</include>
</includes>
</resource>
</resources>
</build>