gradle/gradle — pull request #65 by jesseeichar (2012-02-10 11:09:22+00:00)
Title: Allow Jetty plugin to obtain web resources from several directories.

The use case of this change it to allow a developer to have his web resources split in several directories and be able to develop directly on the sources
rather than on copies.

A suggested alternative is to simply have a build script that copies the data into a temporary directory and use that as the webAppDir. The problem with copying resources to a temporary directory shows up during the development process. Suppose you have a directory of javascript files or (in the case of a few of my projects) xslt files. If the files are copied to a separate directory then there needs to be a mechanism of keeping the two directories in sync, which is quite a pain. Doable but a pain since it requires a thread that continuously monitors the files for changes and copies the changed files. Of course with the syncing you have all the problems of keeping things in sync.

See http://issues.gradle.org/browse/GRADLE-1178.

I am aware that in war you can add extra files using the from option. However JettyRun does not take the from files into account.

I have considered trying to use the from files to build a jetty ResourceCollection but ResourceCollections only accept directories. Since from can have files (and normally does) it is not a good candidate for additional webapp resources (with respect to Jetty).

So to address this I have added a new property for adding additional directories to a war (and JettyRun).

In summary, in this pull request I have done the following things:

* Added option additionalWebAppDirs in the WarPluginConvention object
* Added option additionalWebAppDirs to JettyRun
* Added documentation for new option in the DSL documentation
* Added JettyRun documentation for ScanIntervalSeconds, ScanTargets, ScanTargetPattern, reload
* updated subprojects/docs/src/samples/webApplication/customized project so that the project has some extra customizations, (the ones documented above)