3

I want to run a multi-module project in Eclipse with the Jetty Maven Plugin. The project runs just fine, and running mvn jetty:run-exploded the configuration files get processed correctly.

Maven setup:

/parent/pom.xml
/parent/module-1/pom.xml
/parent/module-2/pom.xml
/parent/module-service/pom.xml (this is the one that builds the webapp)

Eclipse setup: The project and all modules are Maven projects in the workspace, the module projects are also Java projects.

I added the standard Jetty configuration to /module-service/pom.xml and also run Maven on the module-service/pom.xml.

However, when I want to debug I run into the following error when I want to use the content assist:

This compilation unit is not on the build path of a Java project.

Also, hot code replacement does not work. But the variables and all breakpoints are detected correctly! What I do see is that that the editor that opens the file in the parent project (and as a side effect the editor has a different Java file icon, a hollow blue J instead of a full blue J).

Solutions tried so far:

  • Adding the Java facet to the parent project > The source folders get detected correctly but I get just a lot of build path errors because the parent project does not have the pointers to all the libraries of the modules.
  • Adding the modules to the build path of the module-service project.
  • Checking Resolve Workspace artifacts in the Debug configuration (results in error "Failed to copy file for artifact"), possible solved here, but I don't see how.

I use jetty-maven-plugin version 8.1.4.v20120524.

Daniel N.
  • 831
  • 1
  • 7
  • 13

1 Answers1

0

A bit late but maybe useful for somebody.

Try to use jetty:run goal and select "Resolve Workspace artifacts" in Run configurations/Maven Build/yourProject/Main|Tab| (where yourProject is the one you're running with jetty:run goal). Of course you have to have all dependent project imported usig "Import->Existing Maven Project".

Marek Podyma
  • 913
  • 10
  • 12