我web.xml
的是下${project.root}\src\main\webapp\WEB-INF
。
当它被打包在 WAR 中而不是在源目录中时,我想使用它com.google.code.maven-replacer-plugin
来替换其中的一些令牌。
我试过了:
<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
参数中引用它的路径,以便替换器找到它并替换标记?