I'm trying to remove the working sets "Java Main Sources" and "Java Test Sources" from the working sets of the Project Explorer.

I can delete them from the Select Working Set dialogue window, but, they return when Eclipse is restarted. Is there a way to remove them permanently?

After restarting eclipse, I would expect those working sets to not be present.

3

There are 3 best solutions below

1
greg-449 On

These working sets are contributed by the Maven support plug-ins (org.eclipse.m2e.xxx).

There does not seem to be anyway to disable them other than uninstalling the Maven support.

0
Kelly Bang On

The location where Eclipse saves working sets is workspace/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml. If you're on Windows try setting this to readonly, hopefully this works.

When you remove Java Main|Test Sources from Eclipse, it removes the corresponding lines there. However, when you restart Eclipse it generates those lines again.

I'm on Linux, I thought setting the file owner to root:root with -rw-rw-r-- permissions would have been enough. On start up it throws an error, but quickly corrects itself, deletes the folder and reconstructs the settings from the files it was able to read. Setting the folder to root:root as well means you can read the error that is thrown (Cannot save) but it still creates the workspaces, just can't save them for you...

2
Alex1988 On

This worked for me, to solve the problem of the appearance of the directories "Java Main Sources" and "Java Test Sources" you have to go to the Package Explorer and click on the white triangle at the top,

enter image description here

from here select Select Working Set... ,

enter image description here

a window will open where it will be possible to remove by clicking on Remove after having selected the working sets or directories named "Java Main Sources"

enter image description here

and "Java Test Sources".

enter image description here

I hope this was helpful, simple and effective.