Entering the path class org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported

I get this warning in Eclipse:

Entering the path class org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result in

After searching, I found that I needed to export fixes. I have done it.

Eclipse Java Build Path properties

But this warning persists! What else can be done to fix this? Thank.

+59
eclipse maven export
Jul 23 '11 at 9:27 a.m.
source share
15 answers

I tried both options, but only what you need:

  • Mark the associated rawpathpath entry as a publish / export dependency
  • Exclude the associated source path class entry from the potential publication / export set.

If you export the dependency, updating the project configuration via the context menu of Maven β†’ Update Project Configuration will return a warning. In this case, you need to manually edit the .classpath file:

<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> 

Just remove the exported="true" attribute and confirm by updating the project configuration.

+25
Feb 26 '12 at 17:58
source share

You can right-click on the warning, select quickfix and choose one of the following options:

  • Mark the associated rawpathpath entry as a publish / export dependency.
  • Exclude the associated source class path entry from the set of possible publication / export dependencies.

Since you will not publish / export the eclipse project, you can exclude it. But in any case, it does not matter.

Step-by-step screenshots:
http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=/com.ibm.javaee.doc/topics/tlooseclasspath.html

+33
Feb 12 '12 at 11:01
source share

I had the same problem; it disappears after turning on

 <packaging>war</packaging> 

in the room There was no packaging at all.

+11
Sep 15 '13 at 17:15
source share

http://geertschuring.wordpress.com/2009/03/05/why-the-maven2_classpath_container-will-not-be-exported-or-published/

In some cases, Eclipse will present you with the following warning:

 Classpath entry org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result. 

So, enable it, do the following:

 Open the properties of the project that generates this warning Click on "Java Build Path" Click on the tab "Order and Export" Enable "Maven Dependencies" Click on "Ok" Open the "Problems" view Select the warning we are trying to solve, and press "Ctrl-1β€³ Click on "Ok" 

Now the problem is resolved. This may take some time before the warning disappears, because the project needs to be rebuilt before it leaves.

+9
Jan 11 '13 at 9:04 on
source share

I could not solve the problem with quickfix in Eclipse Luna. The problem disappeared after the grant removal of the Dynamic Web Module project grant. In Windows β†’ Settings β†’ Project Boundaries.

enter image description here

PS Packaging as War also decided to release, but it was approved as a JAR, and I was puzzled why some projects worked fine and some didn't.

And by the way, the warning was real. This caused ClassNotFoundExceptions exceptions on the server, which made it unusable when other projects refer to it.

+4
May 08 '15 at 19:59
source share

Just right-click on the warning and make a quick fix

enter image description here

Then you can view the changes to the .classpath file from the source control

enter image description here

+4
Oct 20 '17 at 2:07 on
source share

Most of the answers, including those currently accepted, provide a temporary solution to this problem: every time I select Maven> Update Project ... and leaving the option "Update project configuration from pom.xml", a warning is returned.

However, after installing m2e-wtp - Maven Integration for WTP in Eclipse 4.5 (Mars) and releasing the Update Project ... again, leaving the option selected, the warning (and the resulting error) disappeared.

+1
Jul 23 '15 at 23:54
source share

I have an easy way to solve this problem:

  • Remove the project from Eclipse.
  • To the workspace where the project is located.
  • Delete items selected in the following image. Just leave src and pom.xml .

    enter image description here

  • Reimport the project into your Eclipse.

+1
Sep 12 '17 at 8:05
source share

None of the answers helped in my case. Each time I update a project, m2e removes the entry from the .classpath file, which disables warnings.

I filed a bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=537401

+1
Jul 26 '18 at 8:50
source share

Adding to pom.xml:

 <properties> <java.version>1.8</java.version> </properties> 

helped me in this case, as well as with a dynamic web module and other problems.

0
Feb 09 '17 at 16:16
source share

I also came across this problem! I believe that eclipse adds the same deps twice. once in

Maven Dependencies

Group and another in the form

M2_REPO / ...

You must delete the last one in

Properties β†’ Java Build Path β†’ Libraries

for the mistake to disappear!

0
Feb 09 '18 at 12:10
source share

Using Eclipse Photon, the following configuration fixed the problem for me: " Window > Preferences > Maven > Java EE Integration > Enable Java EE Configuration

Please note that I disabled this option before receiving the warning Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported

All other parameters may not be checked if you do not need them.

A warning does not appear after updating Maven.

0
Nov 18 '18 at 7:43
source share

I had the same problem after updating my JDK in the project, and I solved it by replacing my .classpath file with the previous one. I noticed the following changes in my .classpath file

  <attributes> <attribute name="maven.pomderived" value="true"/> <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> </attributes> 

The second line was missing in the above code

 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 

This line was missing

  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> <attributes> <attribute name="owner.project.facets" value="java"/> </attributes> </classpathentry> 

These lines were added, so I deleted them manually and it worked again.

0
04 Feb '19 at 17:31
source share

Window, settings, validation, class dependency validator, uncheck the manual and assembly

Like most eclipse checks, this one is broken.

-one
Jul 20 '15 at 3:46
source share

This is a typical problem with maven projects configured in Eclipse that have changed its configuration or were not saved properly.

I usually edit the .classpath file and check the links for the build path, etc.

So, in your case, I think you need to remove your classpathentry using the org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER link inside.

-four
Sep 12 '11 at 10:21
source share



All Articles