我正在嘗試將一些過濾添加到駐留在WEB-INF目錄中的應用程序上下文文件中。將Maven文件過濾到WEB-INF中
我在文件夾/ src/main/resources中有要過濾的文件(xmlgateway-context.xml)。
我在文件夾中的src/main /過濾器
屬性文件(config-e05.properties)和我有POM設置如下:
<!-- environment profiles -->
<profiles>
<profile>
<id>e04</id>
<properties>
<targetenv>e04</targetenv>
</properties>
</profile>
<profile>
<id>e05</id>
<properties>
<targetenv>e05</targetenv>
</properties>
</profile>
</profiles>
<!-- build settings (filtering) -->
<build>
<filters>
<filter>src/main/filters/config-${targetenv}.properties</filter>
</filters>
<resources>
<resource>
<targetPath>WEB-INF</targetPath>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
這將MVN正確安裝,但是當我打開輸出war文件時,我期待xmlgateway-context.xml文件位於/ WEB-INF目錄中,但最終會放在/ WEB-INF/classes/WEB-INF文件夾中。
如何將此文件放到正確的位置。
或者,我可以將應用程序上下文放到不同的位置並在那裏引用它。
filteringDeploymentDescriptors我增加了maven- 2標籤,我猜你不介意。 – Bozho 2009-11-23 10:56:44