Jetty

Provide virtual WEB-INF/lib for maven plugin

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 7.2.0
  • Component/s: Maven2
  • Description:
    Hide

    Some projects and products want access to the jars in WEB-INF/lib and the classes in WEB-INF/classes for eg annotation scanning. When running with "mvn jetty:run" these locations do not exist.

    See if it is possible to provide a virtual resource located at WEB-INF for the run mojo that will respond with the dependency jars and target/classes to make these kinds of integrations easier.

    Show
    Some projects and products want access to the jars in WEB-INF/lib and the classes in WEB-INF/classes for eg annotation scanning. When running with "mvn jetty:run" these locations do not exist. See if it is possible to provide a virtual resource located at WEB-INF for the run mojo that will respond with the dependency jars and target/classes to make these kinds of integrations easier.
  1. jetty-1107-test-webapp.zip
    (25 kB)
    Michael Kurz
    20/May/10 9:42 AM
  2. jetty-1107.patch
    (6 kB)
    Michael Kurz
    20/May/10 9:42 AM

Activity

Hide
Michael Kurz added a comment - 20/May/10 9:42 AM

I created a basic hack for this issue to get access to /WEB-INF/lib and /WEB-INF/classes for both MyFaces 2 and Mojarra 2. My solution patches the JettyWebAppContext in the plugin itself to access resources in those directories. There might be a fancier solution, but it works for my applications. The patch is for jetty-7.

Additionally, I provided a JSF-based web application for testing. It is Maven-based, so "mvn jetty:run" (for MyFaces) and "mvn jetty:run -P mojarra" (for Mojarra) should start the app with jetty-maven-plugin 7.1.1-SNAPSHOT.

Show
Michael Kurz added a comment - 20/May/10 9:42 AM I created a basic hack for this issue to get access to /WEB-INF/lib and /WEB-INF/classes for both MyFaces 2 and Mojarra 2. My solution patches the JettyWebAppContext in the plugin itself to access resources in those directories. There might be a fancier solution, but it works for my applications. The patch is for jetty-7. Additionally, I provided a JSF-based web application for testing. It is Maven-based, so "mvn jetty:run" (for MyFaces) and "mvn jetty:run -P mojarra" (for Mojarra) should start the app with jetty-maven-plugin 7.1.1-SNAPSHOT.
Hide
Ian Atha added a comment - 02/Jul/10 1:51 PM

Any update on this? Is there something wrong with the proposed patch?
This affects everyone who attempts to use popular technologies, such as JSF2 (via Mojarra), using Jetty through the jetty:run goal of the jetty-maven-plugin.

Show
Ian Atha added a comment - 02/Jul/10 1:51 PM Any update on this? Is there something wrong with the proposed patch? This affects everyone who attempts to use popular technologies, such as JSF2 (via Mojarra), using Jetty through the jetty:run goal of the jetty-maven-plugin.
Hide
Jan Bartel added a comment - 26/Jul/10 4:09 AM

Hi Michael (or Ian)

I've used the patch, but I've made a few changes to it. I'd like to use the test webapp you've provided, but can you just verify for me how I confirm that webapp is working? If I hit http://localhost:8080/mygourmet11 is that a good enough test?

thanks,
Jan

Show
Jan Bartel added a comment - 26/Jul/10 4:09 AM Hi Michael (or Ian) I've used the patch, but I've made a few changes to it. I'd like to use the test webapp you've provided, but can you just verify for me how I confirm that webapp is working? If I hit http://localhost:8080/mygourmet11 is that a good enough test? thanks, Jan
Hide
Michael Kurz added a comment - 28/Jul/10 2:05 AM

Hi Jan,

the start page should also work without the patch. If you click "edit customer" and submit the form there should be exceptions if the managed beans can't be resolved (which is the case without the patch).

Michael

Show
Michael Kurz added a comment - 28/Jul/10 2:05 AM Hi Jan, the start page should also work without the patch. If you click "edit customer" and submit the form there should be exceptions if the managed beans can't be resolved (which is the case without the patch). Michael
Hide
Jan Bartel added a comment - 29/Jul/10 5:45 AM

Slightly modified patch checked into jetty-codehaus trunk that works with the provided test app. A bit more testing by others would be appreciated.

Show
Jan Bartel added a comment - 29/Jul/10 5:45 AM Slightly modified patch checked into jetty-codehaus trunk that works with the provided test app. A bit more testing by others would be appreciated.
Hide
Michael Kurz added a comment - 18/Aug/10 12:41 PM

I did some further testing with an advanced version of the test webapp including Spring 3, MyFaces Orchestra and Hibernate and it works like a charm.

Show
Michael Kurz added a comment - 18/Aug/10 12:41 PM I did some further testing with an advanced version of the test webapp including Spring 3, MyFaces Orchestra and Hibernate and it works like a charm.
Hide
Jan Bartel added a comment - 24/Aug/10 1:56 AM

Thanks for that Michael. I'll close the issue now.

Jan

Show
Jan Bartel added a comment - 24/Aug/10 1:56 AM Thanks for that Michael. I'll close the issue now. Jan
Hide
Jan Bartel added a comment - 24/Aug/10 1:57 AM

Seems that field testing is showing that the patch works as expected.

Show
Jan Bartel added a comment - 24/Aug/10 1:57 AM Seems that field testing is showing that the patch works as expected.
Hide
Evan Leonard added a comment - 01/Sep/10 2:51 PM

Please make sure this is merged to Jetty 8. This is causing a major pain for us trying to use Freemarker. I believe that every app that uses Freemarker with the maven jetty plugin will run into this issue.

Show
Evan Leonard added a comment - 01/Sep/10 2:51 PM Please make sure this is merged to Jetty 8. This is causing a major pain for us trying to use Freemarker. I believe that every app that uses Freemarker with the maven jetty plugin will run into this issue.

People

Dates

  • Created:
    11/Sep/09 10:35 PM
    Updated:
    Yesterday 2:51 PM
    Resolved:
    29/Jul/10 5:45 AM