Eclipse WTP, maven and m2eclipse - not copying provided jars

余生颓废 提交于 2019-11-30 05:02:51

You have to install the m2eclipse-wtp which is an extra plug-in for m2eclipse .It will do this job for you. After installing the m2eclipse-wtp , just right-click project ---> Maven --> Update Project Configuration , you will find that the libs of the provided scope will not be distrusted to the WTP container anymore.

See this for the installation instruction. I would suggest to install the latest version of m2eclipse-wtp (tested against Eclipse 3.6 +) as it solves some major bugs in the previous versions.

Edit: Thanks Fred for the correction

You need to add the Maven Library to WTP's Deployment Assembly...

Right click on your project, select "Properties"

From the properties menu click "Deployment Assembly"

Click "Add" -> "Java Build Path Entries" then click "Next"

Select "Maven Libraries" on the list and click "Finish"

Dependencies of scope "provided" shouldn't be packaged by Maven in the final assembly.

However, check if you have other dependencies that are "compile" that also declare those same dependencies as "compile". In other words, it's very likely that el-api and jsp-api are being pulled in as transitive dependencies.

Easiest way to check is using the Dependency Hierarchy view of m2eclipse.

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