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.