Hello m2e Community,
 
I have a problem with filtered source files and I hope you know how to fix it.
 
I am editing a simple Java project in Eclipse which worked rather well until I enabled to filter resources by the following POM entry:
 
<sourceDirectory>target/filtered-sources/java</sourceDirectory>
<resources>
       <resource>
             <directory>src/main/resources</directory>
       </resource>
       <resource>
             <directory>src/main/java</directory>
             <filtering>true</filtering>
             <targetPath>../filtered-sources/java</targetPath>
       </resource>
</resources>
 
After “Maven > Update Project…” the situation in Eclipse is:
 
·         /target/filtered-sources/java is correctly treated as a derived source file, i. e. Eclipse warns that all changes are lost as the file gets recreated automatically by the filtering. I think this is OK and wanted.
·         But: /src/main/java’s content is shown with a different (shallow) “J” icon, and Eclipse cannot apply neither “Organize Import” nor “Source > Format” operations. For example, when trying “Organize Import”, Eclipse Indigo says “The resource is not on the build path of a Java project.”. Well, in fact, it actually IS on the build path, but it is EXCLUDED by “**” by m2e (at least the package explorer tells me). This means, all the nice JDT gimmicks are switched off!
 
So editing the original source is rather impossible now! I do not believe that it is wanted by m2e that I cannot use any of the JDT gimmicks?
 
What am I doing wrong?
 
Thanks!
Markus