开发者

Eclipse - marking 10 projects 'target' folder as derived

I would like to mark all of my 'target' directories as 'derived' in Eclipse. However I have about 10 projects and have to repeat the same process 10 times, is there any quick way of marking all 10 'target' folders as开发者_Go百科 derived?


I wrote the AutoDeriv plugin to handle this specific task easily and efficiently. The short story:

  1. list the resources you want to set as derived on a simple .derived text file
  2. There is no 2.

Enjoy your clean workspace as resources are now correctly marked as 'derived'. The syntax is trivial, just like a .gitignore file.

For your specific case, create a .derived file at workspace root, write target in it, and your done.

I hope you will like it =)


Not sure what you mean by 'derived'. However, Eclipse writes most settings to an XML file. Figure out which config file (e.g. .classpath) gets altered and then run sed over all your config files at once.


It is not easy to set the Derived flag automatically, see Where does Eclipse store information about which files are "Derived"?

This is sad as I have to mark 20 subfolders as "Derived" each time I clone my project on a new machine. If you do it manually too, use the keyboard:

  • Alt-Enter
  • Alt-v
  • Enter
  • Cursor down
  • repeat


You got to remove third line from each .classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
    <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
    <classpathentry kind="output" path="target/classes"/>
</classpath>

I.e. remove <classpathentry kind="src" output="target/classes" path="src/main/java"/>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜