David Harkness wrote:

When building the java webapp, I'd like some HTML and JS files to be
packaged into the WAR, but those files live in the "html" and
"javascript" directories instead of in "java/src/main/webapp". What's
the appropriate plugin to use in this case?

On a side note, there are other JavaScript files from those same
directories that get packaged into "WEB-INF/classes" since they need
to be available as resources to the Java code and not as files via
HTTP. This works great, and I want something similar that makes them
available via HTTP instead of to the Java code.

Check out our maven-jstools-plugin [1], see "Packaging JS" [2]. Using that as a normal (i.e non-plugin) dependency in your java webapp will allow you to make HTTP requests to JS files or other static resources (images, html etc.). This works through a highly configurable servlet filter [3].

This will also work for your "html" and "javascript" directories, if you tell maven to treat them as resources.

[1] http://dev.abiss.gr/mvn-jstools/
[2] http://dev.abiss.gr/mvn-jstools/js-packaging.html
[3] http://dev.abiss.gr/mvn-jstools/apidocs/gr/abiss/mvn/plugins/jstools/web/JavascriptDependencyFilter.html

hth,

Manos

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to