Java .classpath文件Classpath entry org.maven.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported o

Classpath entry org.maven.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published

在实际用Maven构建Java Web项目开发过程当中,有时候会出现上述状况的警告,若是不解决这个警告,就会在启动Web服务器的时候抛出没法加载Maven管理的第三方jar包的异常。服务器

因此,要解决上面的问题主要包含如下几个步骤:eclipse

1.首先在项目的根目录找到.classpath文件而后打开该文件,找到如下标签内容,而后添加下面绿线标注的标签内容:
maven

 

<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">ui

 

                <attributes>spa

 

                        <attribute name="maven.pomderived" value="true"/>component

 

                        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>blog

 

                </attributes>ip

</classpathentry>ci

2.而后,在Eclipse项目管理器选种你的项目,右键依次选择Build Path->Configure Build Path->Order and Export,勾选Maven Dependencies,单击Ok项目管理

3.最后,clean当前项目,而后查看Problems选项卡下的Warning中是否还有Classpath entry org.maven.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published警告,若是没有了,那问题就解决了。

接着启动服务器,就不会抛出没法加载Maven管理的第三方jar包的异常了。

相关文章
相关标签/搜索