Since version 1.1.2 Gretty supports web-app extra resource bases. It means: additionally to "src/main/webapp" you can specify arbitrary directories that should be served as content of the given web-app.

Syntax

gretty {
  extraResourceBase 'directory1'
  extraResourceBase 'directory2'
  extraResourceBases 'directory3', 'directory4'
}

extraResourceBase is a function accepting string or java.io.File

extraResourceBases is a function accepting a list of strings or java.io.File objects

You can call extraResourceBase and extraResourceBases multiple times. The specified directories are added to internal collection of extra resource bases.

Effects

Web-app serves the specified directories at the web-app context path.

When Gretty assembles a product, it copies extra resource bases into product directory and registers them within "server.json". The running product serves extra resource bases listed in "server.json".

Gretty sources contain example program demonstrating web-app extra resource bases at work.