Annoyance - How to disable Eclipse classpath entry warnings

前端 未结 2 1688
梦谈多话
梦谈多话 2021-02-12 05:02

I\'ve searched the options but I can\'t seem to find a way to disable these warnings. Warnings such as this:

Classpath entry org.eclipse.jdt.junit.JUNIT_CONTAINER/4 w         


        
相关标签:
2条回答
  • 2021-02-12 05:43

    A quick fix for a whole project (may be too greedy though). Assumes linux utilities (or cygwin):

    cp .classpath classpath-bak
    cat classpath-bak | sed 's@^\(\s*<classpathentry kind=.*\)/>\s*$@\1><attributes><attribute name="org.eclipse.jst.component.nondependency" value=""/></attributes></classpathentry>@' > .classpath
    
    0 讨论(0)
  • 2021-02-12 05:53

    bug 190783 might be relevant to this question.

    this warning will now have two Quick Fixes:

    -one that adds the "dependency" attribute (this is the current quick fix)

    -one that adds the "nondependency" attribute; the addition of this attribute will explicitly exclude the cp entry from consideration as a potential publish/export dependency. If the user changes their mind, they can remove this attribute via the JDT build path UI.

    As Mondain comments:

    I found it! Right click on the warning and select quick fix, yay!

    That is indeed how you can use Quick Fix: See also FAQ What is a Quick Fix?, Quick Fix, and Quick Assist

    alt text

    0 讨论(0)
提交回复
热议问题