0

When a Maven project is imported by m2e, I need some custom project-specific settings to be automatically included in the .project file (eg. a <filteredResources> element).

How and where can I configure such settings? I found no "place" for it in the pom.xml...

snorbi
  • 2,590
  • 26
  • 36
  • I found a similar question, but without anser... http://stackoverflow.com/questions/14006325/how-to-set-eclipse-project-specific-validation-preferences-with-m2e – snorbi Jan 08 '16 at 13:20
  • Could you explain more what you want to acheive? – Tunaki Jan 08 '16 at 13:30
  • For example: adding a element to the .project file. This corresponds to the Eclipse settings: Project Properties / Resource / Resource Filters – snorbi Jan 08 '16 at 13:46
  • I need the exact same feature. I have nested maven modules and I have launch configurations defined in them. But because of the nesting I am seeing the launch configs 3 times (per nesting level). So I wanted to filter those resources... the documentation of m2e is really basic. – David Nouls Jan 04 '17 at 13:05

1 Answers1

0

One way you could achieve this is by using a resource filters extension. The resource filters extension allows plug-ins to define filters that are useful for filtering out file types in the resource navigator view.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension point="org.eclipse.ui.navigator.navigatorContent">
      <commonFilter
        description="Hides node_modules folder"
        id="com.pilot.plugins.nodefilter"
        name="node_modules"
        activeByDefault="true">
        <filterExpression>
            <and>
                <adapt type="org.eclipse.core.resources.IResource">
                    <test property="org.eclipse.core.resources.name" value="node_modules"/>
                </adapt>
            </and>
        </filterExpression>
    </commonFilter>
    </extension>
    <extension point="org.eclipse.ui.navigator.viewer">
    <viewerContentBinding
          viewerId="org.eclipse.ui.navigator.ProjectExplorer">
          <includes>
            <contentExtension pattern="com.pilot.plugins.nodefilter"/> 
          </includes>
    </viewerContentBinding>
    </extension>
ComputerPilot
  • 39
  • 1
  • 1
  • 3