WTP - m2e not deploying transitive dependencies

陌路散爱 提交于 2019-12-04 02:26:22

I think it is not a problem of your project organization. Your issue is very similar to this m2e-wtp bug report.

It seems to be a Eclipse Juno and WTP Plugin problem.

I had the same problem and i solved in this way:

  1. Backup your eclipse workspace and your project code
  2. remove your project from eclipse (without remove the contents)
  3. open a command terminal (cmd)
  4. run mvn eclipse:clean
  5. run mvn eclipse:eclipse -Dwtpversion=2.0
  6. edit your eclipse classpath file with a text editor: %PROJECT_PATH%\.classpath
  7. remove all lines with attribute kind="var" from your .classpath file. For example:

    < classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>

  8. save file & close editor.
  9. in eclipse, click on: file->Import...->Maven->import existing maven project, and import your project again
  10. Maven -> Update Project (if you want)
You could see on deployment assembly in eclipse project properties that problem is solved and the maven dependencies are there.

Hope this helps.

I also have this problem. I have an ugly workaround:

Put all the original war's dependencies in a separate project (type jar) and make both original war and overlay war depend on that. So for the example:

A.jar -> B.war -> C.war

becomes

A.jar -> B-dependencies.jar (new module called B-dependencies created)

B-dependencies.jar -> B.war

B-dependencies.jar -> C.war

Note that it's not specific to Tomcat; I'm using JBoss.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!