Created
April 7, 2013 06:25
-
-
Save dwelch2344/5329291 to your computer and use it in GitHub Desktop.
Executable WAR example via Tomcat Maven Plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<!-- Your stuff here... --> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.tomcat.maven</groupId> | |
<artifactId>tomcat7-maven-plugin</artifactId> | |
<version>2.1</version> | |
<executions> | |
<execution> | |
<id>tomcat-run</id> | |
<goals> | |
<goal>exec-war-only</goal> | |
</goals> | |
<phase>package</phase> | |
<configuration> | |
<path>/</path> | |
<finalName>exec-${project.build.finalName}.jar</finalName> | |
<!-- optional only if you want to use a preconfigured server.xml file --> | |
<!-- <serverXml>src/main/conf/server.xml</serverXml> --> | |
<!-- War dependencies --> | |
<!-- | |
<warRunDependencies> | |
<warRunDependency> | |
<dependency> | |
<groupId>a groupId</groupId> | |
<artifactId>and artifactId</artifactId> | |
<version>version</version> | |
<type>war</type> | |
</dependency> | |
<contextPath>/</contextPath> | |
</warRunDependency> | |
</warRunDependencies> | |
--> | |
<!-- naming is disabled by default so use true to enable it --> | |
<enableNaming>true</enableNaming> | |
<!-- extra dependencies to add jdbc driver, mail jars, etc. --> | |
<!-- <extraDependencies> | |
<extraDependency> | |
<groupId>org.apache.derby</groupId> | |
<artifactId>derby</artifactId> | |
<version>10.1.3.1</version> | |
</extraDependency> | |
<extraDependency> | |
<groupId>javax.mail</groupId> | |
<artifactId>mail</artifactId> | |
<version>1.4</version> | |
</extraDependency> | |
</extraDependencies> --> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment