title: Problem when importing Maven2 project in Eclipse
body: <p>In my project, I have a resources directory (<code>src/main/resources</code>) that contains properties and XML files.</p>
  
  <p>I want to filter only the properties files, but not any others kind of files (XML for example). Thus, I've set this in my <code>pom.xml</code>:</p>
  
  <pre><code>&lt;build&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/*.properties&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/resource&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;false&lt;/filtering&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;**/*.properties&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>This is working well when I run a Maven 2 package command, i.e. both XML and properties files are included in my final JAR, and only properties files have been filtered.</p>
  
  <p>However, as I want to include this project in Eclipse, when I run the command <code>mvn eclipse:eclipse</code>, and import the project, then I have a problem with the source declared in my project properties.</p>
  
  <p>In the "Java Build Path" option of Eclipse for my project, in tab "Source", I see the <code>src/main/resources</code> directory, but Eclipse also add filters which say to exclude all java files (<code>Excluded: **/*.java</code>) and include <strong>only</strong> properties files (<code>Included: **/*.properties</code>).</p>
  
  <p>In the <code>.classpath</code> file generated, I get this line:</p>
  
  <pre><code>&lt;classpathentry kind="src" path="src/main/resources" including="**/*.properties" excluding="**/*.java"/&gt;
  </code></pre>
  
  <p>This way, the JAR built by Eclipse is not correct as all my XML files are not in the JAR.</p>
  
  <p>How can I solve this problem?</p>
  
  <hr/>
  
  <p>Edit, regarding this <a href="http://maven.apache.org/plugins/maven-eclipse-plugin/examples/specifying-source-path-inclusions-and-exclusions.html" rel="nofollow noreferrer">page</a>, I've added this in my <code>pom.xml</code>:</p>
  
  <pre><code>    &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.6&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;sourceIncludes&gt;
                      &lt;sourceInclude&gt;**/*.xml&lt;/sourceInclude&gt;
                  &lt;/sourceIncludes&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>
  
  <p>However, the .classpath generated is not modified with the adequate information...</p>
  
  <hr/>
  
  <p>Edit again.</p>
  
  <p>The addition in my previous edit works only for version 2.6.1+ of the Eclipse plugin, not for 2.6. So, I've tried with version 2.7. However, I don't know how to force the Eclipse plugin to not define the <em>including</em> attribute:</p>
  
  <pre><code>    &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.7&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;sourceIncludes&gt;
                      &lt;sourceInclude&gt;*&lt;/sourceInclude&gt;
                  &lt;/sourceIncludes&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>
  
  <p>If I run the <code>mvn eclipse:eclipse</code> command, I get the following error:</p>
  
  <pre><code>Request to merge when 'filtering' is not identical. Original=resource src/main/resources: output=target/classes, include=[**/*.properties], exclude=[**/*.java], test=false, filtering=true, merging with=resource src/main/resources: output=target/classes, include=[], exclude=[**/*.properties|**/*.java], test=false, filtering=false
  </code></pre>