Support

Forums

Contact Me

Apache M2Eclipse: Get rid of Duplicate resources when opening resources and types

In this small post, I’ll show you how to remove duplicated resources in the Open Resource view of Eclipse

Eclipse – M2Eclipse – Subversive

Activate Maven Modules Filter

Without on the left, with the Maven Modules Filter active, a more clean view on your projects

ApacheM2eGetRidOfDerivedResourcesWhenOpeningResourcesAndTypes_000ApacheM2eGetRidOfDerivedResourcesWhenOpeningResourcesAndTypes_001

Disturbing is that resources are duplicated in view

ApacheM2eGetRidOfDerivedResourcesWhenOpeningResourcesAndTypes_003

Ill show you now how to remove them!

How to remove duplicated resources in the Open Resource view of Eclipse

  • Create one working set with ALL your top Maven modules, named top for example
  • Create another working set for all of your maven modules and put only the maven modules inside

So it look like this

ApacheM2eGetRidOfDerivedResourcesWhenOpeningResourcesAndTypes_004

Now in open Resource, click on the icon menu, and select “Select Working Set”

ApacheM2eGetRidOfDerivedResourcesWhenOpeningResourcesAndTypes_005

Only select the working set “modules”

ApacheM2eGetRidOfDerivedResourcesWhenOpeningResourcesAndTypes_006

Enjoy the result

ApacheM2eGetRidOfDerivedResourcesWhenOpeningResourcesAndTypes_007

By the way, I recommend you to only synchronize the working “top” for avoiding having to look at duplicated changes in synchronize view.

Launch configurations stored in modules may also be duplicated in the menus and in the Run dialog, there also you can apply the same trick: aka using windows working set filtering…

About “Hide folders of physically nested modules (experimental)”

There is experimental option to hide folders of physically nested modules (see Window->Preferences->Maven), but it relies on optional eclipse APIs and does not guarantee all plugins will actually ignore hidden resources. Make sure to reimport all projects into workspace if you decide to try this. Platform debug and subversive are expected to respect IResource#isHidden state, so you should not see any duplicates when this flag is on.

You might also like:
Easily Compress Web Application Resources with EhCache
246 days ago
Easily Compress Web Application Resources with EhCache
Resources such as JavaScript and CSS files can be compressed before being sent to the browser, imp
Tomcat 7 and Apache Maven
246 days ago
Tomcat 7 and Apache Maven
Here is 3 different way to control the lifetime a local Tomcat 7 container using Apache Maven. A t
Apache Maven copy local file to a remote server server using
434 days ago
Apache Maven copy local file to a remote server server using
I will show you in an Apache Maven configuration file how to copy files to server each time the pa
Apache Maven 3 Cookbook
582 days ago
Apache Maven 3 Cookbook
  First a big thanks to Packt Publishing for having sent me this book to review! I did enj
Apache Maven 3 Cookbook Review
628 days ago
Apache Maven 3 Cookbook Review
Thanks to Packt Publishing for having sent me this book to review. I will publish a review in the
List conflicting dependencies in the Maven reactor
744 days ago
List conflicting dependencies in the Maven reactor
The Maven Dependency Plugin among other things include a dependency:analyze-duplicate The depe
blog comments powered by Disqus

Donations

Thank You for supporting my work