ben*_*rre 10 intellij-idea maven
我注意到,当您配置Maven项目以使用属性过滤时,属性过滤似乎也可以在非maven IntelliJ"make"期间工作.这意味着Jetty/Tomcat/GWT/Glassfish的IntelliJ运行配置仍将遵循您的maven资源过滤.
所以如果我把它添加到我的pom.xml:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
<include>**/persistence.xml</include>
</includes>
</resource> ....
Run Code Online (Sandbox Code Playgroud)
在任何intellij运行配置启动之前,它应该过滤我的属性和peristence.xml文件中的任何属性.这对于交换JDBC引用或文件系统参数非常有用.
我遇到的唯一问题是,即使我更改pom.xml以获得其他目录的第二个条目(即:src/integrationtest/resources),IntelliJ似乎也只是尊重src/main/resources中的过滤.
这一切似乎都是"自动化的".那么它如何工作以及我可以在哪里(如果有的话)配置它?
IntelliJ IDEA 的 Make 功能能够过滤 Maven 资源。然而,IntelliJ IDEA尚不支持过滤Web资源。
来源:http
://www.jetbrains.com/idea/webhelp/maven.html#compile
不过,在整个 intellij webhelp 中没有关于此支持的更多详细信息,所以我想它应该像 maven 的 process-resources 阶段一样工作。
您遇到的问题可能是由于目录src/integrationtest/resources不遵循 Maven 约定造成的。也许它会起作用,如果你:
src/test/resources/integrationtest/或者
src/integrationtest测试源(但如果integrationtest不是众所周知的约定,则会违反 Maven 的 COC 规则)或者
integrationtest 至于过滤目录的不同之处在于src/main/resources:过滤src/main/webapp/META-INF对我来说是开箱即用的。
(Maven 3.0.4、Intellij 12.1.4)