A fork from Eclipse's jetty-maven-plugin to honor <webResources>
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



This is a fork Eclipse's jetty-maven-plugin (org.eclipse.jetty:jetty-maven-plugin:9.0.3.v20130506 exactly) to honor <webResources> configuration for the maven-war-plugin.

The Problem

When developing web apps in Maven, it's a common practice to store the Javascritp sources under src/main/js. This requires configuring the maven WAR plugin accordingly:


In this scenario you have two options to use Jetty plugin for rapid develop-test cycle:

  • Configure the resource plugin to copy the Javascript files in the generate-resources fase to the proper web-app folder.
  • Use jetty:run-exploded instead of jetty:run

Both options prevent Jetty to reflect Javascript code changes without additional user actions, and the latest can take a considerable amount of time for large-size projects.

My Solution

Modify the run goal in the jetty-maven-plugin to read and honor the <webResources> section. Jetty resources are now the source files themselves, so that any change in the Javascript files will be inmediatly refelectedby Jetty.

The developer only needs to use the "forked" version of the Jetty plugin



Filtered web resources (those configured with <filtering>true</filtering>) are not included by default. You can control this behavior using the includeFilteredWarResources configuration property


Did you like it?

I've posted a patch with this solution to the Jetty project at Eclipse. Comments supporting the enhancement are welcome. Meanwhile I've uploaded the modified plugin to my personal Maven repository. You can grab it from there tweaking your POM like this: