我想将copie文件与我的个人资料标识符进行比较。
我启动此命令:
mvn -Pprod install
我有这个错误:
[错误]无法执行目标 org.apache.maven.plugins:Maven的资源 - 插件:2.4:复制资源 项目顶点上的(copy-web.xml):目标的执行copy-web.xml org.apache.maven.plugins:Maven的资源 - 插件:2.4:复制资源 失败:基地 D:\ workspace \ apex \ src \ main \ webapp \ WEB-INF \ web.prod.xml不是 目录 - > [帮助1]
我的pom.xml:
<properties>
<webXmlFile>web.xml</webXmlFile>
<profileVersion>defaultVersion</profileVersion>
</properties>
<profiles>
<profile>
<id>dev</id>
<properties>
<profileVersion>DEV</profileVersion>
<webXmlFile>web.dev.xml</webXmlFile>
</properties>
</profile>
<profile>
<id>preprod</id>
<properties>
<profileVersion>PREPROD</profileVersion>
<webXmlFile>web.preprod.xml</webXmlFile>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profileVersion>PROD</profileVersion>
<webXmlFile>web.prod.xml</webXmlFile>
</properties>
</profile>
</profiles>
<build>
<finalName>app-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-web.xml</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${basedir}/target/classes/WEB-INF</outputDirectory>
<resources>
<resource>
<directory>/src/main/webapp/WEB-INF/${webXmlFile}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
...
...
...
答案 0 :(得分:2)
您需要使用包含文件:
<resource>
<directory>/src/main/webapp/WEB-INF/</directory>
<includes>
<include> ${webXmlFile}</include>
</includes>
</resource>