Community
Participate
Working Groups
Build Identifier: Build id: 20110218-0911 We're using the jetty-maven-plugin (Jetty 7) under Eclipse to debug webapps. The plugin doesn't seem to know anything about Eclipse workspace resolution. In Eclipse, when one project depends on another, and the dependency is on a -SNAPSHOT version, Eclipse will put the other project's /target/classes directory on the classpath instead of the .jar file in the local maven repo. This workspace resolution makes it far easier to make little changes across projects and debug them, rather than having to do a full Maven build each time. Unfortunately, the jetty-maven-plugin doesn't do this. I have to do a full build each time. It's a particular pain when you have a multi-module project, and you want to make changes in the myproject-core module and see them reflected in the webapp. Enabling "Resolve workspace artifacts" in the Run Configuration does not solve the problem. The problem *might* be that JettyRunMojo has the annotation: @requiresDependencyResolution runtime when it should probably be @requiresDependencyResolution compile //or possibly compile+runtime Reproducible: Always Steps to Reproduce: 1. Create two Eclipse projects. Make the first a -SNAPSHOT version 2. Make the second depend on the first. Make sure workspace resolution is set up and working. 3. In the second, use jetty-maven-plugin to launch a webapp. 4. Make a change in the first project. Refresh or rerun the jetty-maven-plugin without first doing a mvn package or install. 5. See that the change is not reflected in the webapp.
There are several other options available for debugging web applications under Eclipse using Jetty, such as Jetty WTP plugin (see http://wiki.eclipse.org/Jetty_WTP_Plugin for documentation), as well as M2Eclipse Web Application Runner (a.k.a Webby) (see http://goo.gl/3cN0w).
(In reply to comment #0) > Build Identifier: Build id: 20110218-0911 > > We're using the jetty-maven-plugin (Jetty 7) under Eclipse to debug webapps. > The plugin doesn't seem to know anything about Eclipse workspace resolution. > > In Eclipse, when one project depends on another, and the dependency is on a > -SNAPSHOT version, Eclipse will put the other project's /target/classes > directory on the classpath instead of the .jar file in the local maven repo. > This workspace resolution makes it far easier to make little changes across > projects and debug them, rather than having to do a full Maven build each time. > > Unfortunately, the jetty-maven-plugin doesn't do this. I have to do a full > build each time. It's a particular pain when you have a multi-module project, > and you want to make changes in the myproject-core module and see them > reflected in the webapp. > > Enabling "Resolve workspace artifacts" in the Run Configuration does not solve > the problem. > > The problem *might* be that JettyRunMojo has the annotation: > > @requiresDependencyResolution runtime > > when it should probably be > > @requiresDependencyResolution compile //or possibly compile+runtime > > > Reproducible: Always > > Steps to Reproduce: > 1. Create two Eclipse projects. Make the first a -SNAPSHOT version > 2. Make the second depend on the first. Make sure workspace resolution is set > up and working. > 3. In the second, use jetty-maven-plugin to launch a webapp. > 4. Make a change in the first project. Refresh or rerun the jetty-maven-plugin > without first doing a mvn package or install. > 5. See that the change is not reflected in the webapp. This is best done using a m2eclipse extension and build participant if you are using m2eclipse 1.0.0. In fact the jetty plugin probably won't even be run depending on which phase you specify it to run during a maven build.