Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a classpath entry as a publish/export dependency in an Eclipse dynamic web project?

Tags:

eclipse

maven

I successfully created a project using Wicket quickstart and turned it into an Eclipse dynamic web project by running

mvn eclipse:clean eclipse:eclipse -Dwtpversion=2.0

I imported the project to Eclipse without any issues, but got this warning for each JAR:

Classpath entry M2_REPO/**.jar will not be exported or published.
Runtime ClassNotFoundExceptions may result.

I can fix this by using right click → QuickFix on each warning and selecting "Mark the associated raw classpath entry as a publish/export dependency," but this takes a lot of time and would not be possible if there were a lot of dependencies.

There must be a way to have Maven do this for me; what is it?

EDIT: I've found out that using m2eclipse core + Maven Integration for WTP (from m2eclipse extras) resolves my issues.

I'm still interested in how to achieve this without m2eclipse, though, just out of curiosity :p

like image 382
Holm Avatar asked May 31 '11 20:05

Holm


1 Answers

The two Maven plugins needed to work with web projects in Eclipse are available from the Eclipse Marketplace.

Maven Integration for Eclipse (included in the Java version of Eclipse)

Maven Integration for Eclipse WTP

like image 167
Holm Avatar answered Oct 25 '22 02:10

Holm