I\'m getting this warning in Eclipse:
Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFo
I had the same problem; it vanishes after including
<packaging>war</packaging>
in the pom. There was no packaging at all.
I had tried both of the options but only the latter is what you need:
If you export the dependency, refreshing the project configuration via Maven -> Update Project Configuration context menu will cause the warning to return. In this case you need to edit the .classpath file by hand:
<classpathentry kind="con" exported="true" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
Simply delete have the attribute exported="true"
and confirm by refreshing the project configuration.
I wasn't able to solve the problem with the quickfix in Eclipse Luna. The problem disappeared after removing the Project Facet "Dynamic Web _Module". In Windows -> Preferences -> Project Facets.
P.S. Packaging as War also solved the issued but it was suppoused to be a JAR and I was puzzled why some projects worked ok and some didn't.
And by the way, the warning was real. It caused a ClassNotFoundExceptions exceptions in the server that made it unsusable when other projects referenced this.
You can right click on the warning, choose quickfix and choose one of the following:
As you will not have eclipse publishing/exporting the project it is safe to exclude it. But either way it makes no difference
Step by step screenshots:
http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=/com.ibm.javaee.doc/topics/tlooseclasspath.html
I have a simple way to solve this problem:
Delete the items selected in the following image. Just leave src
and pom.xml
.
Re-import the project in your Eclipse.
Using Eclipse Photon, the configuration below fixed the problem for me:
Window > Preferences > Maven > Java EE Integration > Enable Java EE Configuration
Note that I disabled this option before receiving the warning
Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported
All other options may not be checked if you do not need them.
The warning does not reappear after a Maven update.