I keep getting this error whenever I run unit tests in IntelliJ IDEA:
/home/egervari/IdeaProjects/jobprep-stable/src/main/resources/dict/noun.txt
Maven: File is too big to be filtered. Most likely it is a binary file an开发者_StackOverflow中文版d should be excluded from filtering.
The thing is, I do explicitly exclude this file:
<filters>
<filter>src/main/filters/environment.${env}.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>src/main/resources/dict**</exclude>
</excludes>
</resource>
</resources>
Is my pom.xml written incorrectly? How do I get IDEA to honor what I actually wrote?
Basically what I want to achieve is make everything in that resources directory part of the classpath, but I only want to filter applicationContext.xml. Basically, I want maven/idea to not touch the other files, because there is 20 meg in there easily.
This is the solution.
<filters>
<filter>src/main/filters/environment.${env}.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/dict</directory>
<filtering>false</filtering>
</resource>
</resources>
Tests run much faster now when booting up.
You could also filter based on file types instead of purely location:
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
There is an <excludes>
tag also.
精彩评论