我有以下maven配置:
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>keystore.jks</exclude>
</excludes>
</resource>
</resources>
我希望keystore.jks
包含在我的类/ war应用程序中,但不要由Maven过滤处理。
如何更改此配置?
答案 0 :(得分:21)
根据Maven Resource Filtering Documentation,这应该有效:
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>keystore.jks</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>keystore.jks</include>
</includes>
</resource>
</resources>
答案 1 :(得分:4)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>jks</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>