Maven管理的jar没有发布到Tomcat服务器WEB-INF/lib

问题描述:

  在启动maven web项目的时候,出现以下异常,

  

  并且tomcat中发布的项目lib中找不到jar包。

解决方案:

  标准web工程通过m2eclipse添加依赖管理步骤:
  1、“Maven ” –> “Enable dependency Management“

  2、Web Deployment Assembly中添加maven dependencies

步骤如下图:

工程 -> 右键 -> preferences

 

 

 

 


.classpath文件中会有修改

<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>    
 

<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">  
        <attributes>  
            <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>  
        </attributes>  
    </classpathentry>  

 

(执行“Maven ” –> “Update Project Configuration “未生效,故手动添加。必须deploy时候才会拷贝jar包到lib目录下,而非在更新maven依赖时候拷贝jar包。 )

posted on 2017-02-28 19:05  小鸟的士林  阅读(210)  评论(0)    收藏  举报

导航