【发布时间】:2016-12-29 14:50:15
【问题描述】:
我的web.xml 在${project.root}\src\main\webapp\WEB-INF 之下。
我想用com.google.code.maven-replacer-plugin替换其中的一些标记当它被打包在WAR中而不是在源目录中时。
我试过了:
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>src/main/webapp/WEB-INF/web.xml</file>
<replacements>
<replacement>
<token>@@sec.level@@</token>
<value>local</value>
</replacement>
</replacements>
</configuration>
</plugin>
但我得到了
[ERROR] File '.\src\main\webapp\WEB-INF\web.xml' does not exist
由于该文件不是在target 文件结构下复制的,而是直接从源中获取到WAR 中(或者我认为),我如何在上面的configuration->file 参数中引用它的路径,以便replacer 找到它并替换令牌?
【问题讨论】:
标签: maven maven-replacer-plugin