--- Executable War --- Olivier Lamy --- 2011-01-10 --- ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Build an Executable War/Jar Since version 2.0 you can now build an executable war/jar with an embedded Apache Tomcat7. This is only supported with the tomcat7 plugin. <> Your project must have packaging pom or war. * Additional Artifact to your war module +-- ... war or pom ... ... ... org.apache.tomcat.maven tomcat7-maven-plugin ${project.version} tomcat-run exec-war-only package foo src/main/tomcatconf/server.xml default value is exec-war but you can customize default value is jar ... ... ... +-- * Additional Artifact to your pom module +-- ... war ... ... ... org.apache.tomcat.maven tomcat7-maven-plugin ${project.version} tomcat-run exec-war-only package a groupId and artifactId version war / true org.apache.derby derby 10.1.3.1 javax.mail mail 1.4 ... ... ... +-- * Generated executable jar/war You will be able to execute the generated jar which contains an embedded tomcat container +------ java -jar yourjar +------ Help output +------ usage: java -jar [path to your exec war jar] -ajpPort ajp port to use -clientAuth enable client authentication for https -D key=value -extractDirectory path to extract war content, default value: .extract -h,--help help -httpPort http port to use -httpProtocol http protocol to use: HTTP/1.1 or org.apache.coyote.http11.Http11Nio Protocol -httpsPort https port to use -keyAlias alias from keystore for ssl -loggerName logger to use: slf4j to use slf4j bridge on top of jul -obfuscate obfuscate the password and exit -resetExtract clean previous extract directory -serverXmlPath server.xml to use, optional -X,--debug debug +------