Maybe the better solution is to stick to Maven convention, which specifies that the root directory of your Web application is src/main/webapp
.
So if you put all your Javascript files in src/main/webapp/javascript
(or src/main/webapp/js
), they will be integrated in your final war package.
In the Maven WAR plugin, they give some descriptions (see here for example) about the content of the directories. For example:
|-- pom.xml
`-- src
`-- main
|-- java
| `-- com
| `-- example
| `-- projects
| `-- SampleAction.java
|-- resources
| `-- images
| `-- sampleimage.jpg
`-- webapp
|-- WEB-INF
| `-- web.xml
|-- index.jsp
`-- jsp
`-- websource.jsp
As you can see, you can put resources in webapp/xxx
directory, such as jsp
file here.
As stated by cuh, you can also configure the Maven WAR plugin if your directory structure is different.