Adding other files to the WAR file

It is possible to add any kind of files to the WAR file. This is particulary useful if you want to deploy a web site at the same time as your API.

To do it add content elements to the impl.xml file. Note that you'll need to also add a web-path attribute to the impl element because the API is by default mapped with the root path. So in order to access the file you have added to the WAR file, you will need to associate the API with another path.

Example:

<impl web-path="store">
  <content dir="apis/petstore" includes="xslt/*.xslt" />
  <content dir="apis/petstore/web" includes="*.html *.js" />
  <content dir="apis/petstore/web" includes="*.jpg" web-path="images" />
</impl>

Note

If you only want to add files to the WEB-INF directory, for example to use them in your API, then you don't need to specify the web-path attribute to the impl element.