maven dependencies and jetty - avoiding deploy
I have a project with 3 artifacts:
common - entities, business logic. no UI code webapp-a - a public web app webapp-b - an admin web app
webapp-a and webapp-b depend on common. common is configured to deploy to a local maven repo.
so far so good.
I have IntelliJ configured so that each artifact is a separate module. Module dependencies are configured properly. I can add a new method to a class in common and immediately use that method in a class in a webapp.
However, when I run mvn jetty:run it uses the currently deployed common snapshot in my repository. It does not use my local classes. If I add a method to a class in common, it compiles fine, but blows up at runtime.
So is it possible to either:
a) Convince jetty:run to use my local common build output
b) Deploy my common output to my local ~/.m2/repo while I'm testing locally before I want to commit/deploy
c) some other solution?
If you want to use mvn jetty:run then your common module must be installed. Maven won't pick your unpackaged/uninstalled classes.
The alternative I'm using is simply running Jetty direct from the IDE as a pseudo-unit test. Here's a sample project if you wish. The RunDemoHelloWorld (runnable with JUnit) starts Jetty directly from Eclipse. Should work in IDEA as well.