This plug-in provides the ability to generate either a deployed webapp or a webapp packaged as a WAR file.
If you need to add extra dependencies in the web application, there are two properties you can use.
war.bundle | This property includes the dependency in
/WEB-INF/lib |
war.target.path | This bundles the dependency in the path specified relative to the base of the web application. |
war.target.filename | This specifies the filename of the
the dependency in the path specified by the war.target.path property. |
For example, the following adds commons-lang to /WEB-INF/lib
,
myApplet to the /applets
directory and anotherApplet in
/applets/another-applet.jar
.
<dependency> <id>commons-lang</id> <version>2.0</version> <properties> <war.bundle>true</war.bundle> </properties> </dependency> <dependency> <id>myApplet</id> <version>1.4</version> <properties> <war.target.path>applets</war.target.path> </properties> </dependency> <dependency> <id>anotherApplet</id> <version>1.2</version> <properties> <war.target.path>applets</war.target.path> <war.target.filename>another-applet.jar</war.target.filename> </properties> </dependency>
If you need to copy the web.xml file in order to replace some
filter tokens or simply perform some custom modification to it,
simply write a pre-goal to the war:war-resources
goal in which you perform the manipulation. Then set the
maven.war.webxml
property to point to your modified
web.xml
.