For banners that are not distributed by the Maven repository, the easiest way is to place additional banks in the src/main/webapp/WEB-INF/lib your project. Maven, by convention, will include everything under src/main/webapp in the final military artifact.
An additional method is to use the Maven War Plugin . It has the ability to add additional files to the final artifact of the war, although the configuration of the plugin.
In the POM build section, add something like the following:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <webResources> <resource> <directory>src/main/resource/extra-jars</directory> <includes> <include>*.jar</include> </includes> <targetPath>WEB-INF/lib</targetPath> </resource> </webResources> </configuration> </plugin> </plugins> </build>
The <configuration> section is the key to adding additional files.
- The
<directory> element defines the location of the resource source. The path refers to pom.xml . - The
<includes> element determines which files found in the above directory should be included. - The
<targetPath> element defines the destination directory in the WAR to which the files are copied.
Brent worden
source share