-
-
Save actionjack/1245003 to your computer and use it in GitHub Desktop.
mvn snippet to create an rpm for tomcat war
This file contains 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
<pluginManagement> | |
<plugins> | |
<!-- | |
The RPM plugin is used to create distributable apps from our war file. | |
To use it fire: | |
$ mvn install rpm:rpm | |
... | |
The resulting rpm is then found at Project/target/rpm/Project/RPMS/noarch/Project-versoin-1.noarch.rpm | |
For example: ImageServer/target/rpm/ImageServer/RPMS/noarch/ImageServer-6.5.0-1.noarch.rpm | |
--> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>rpm-maven-plugin</artifactId> | |
<version>2.1-alpha-1</version> | |
<configuration> | |
<group>outbrain</group> | |
<mappings> | |
<mapping> | |
<directory>${rpm.context.file.target}</directory> | |
<configuration>true</configuration> | |
<filemode>755</filemode> | |
<username>${rpm.file.owner}</username> | |
<groupname>${rpm.file.owner}</groupname> | |
<sources> | |
<source> | |
<location>${rpm.context.file.source}</location> | |
</source> | |
</sources> | |
</mapping> | |
<mapping> | |
<directory>/home/tomcat/wars</directory> | |
<filemode>755</filemode> | |
<username>${rpm.file.owner}</username> | |
<groupname>${rpm.file.owner}</groupname> | |
<!-- | |
The following adtifact/classifiers/classifier voodoo is required to get the | |
projects main artifact into the rpm (and only the main artifact, without the | |
test artifact. | |
See http://mojo.codehaus.org/rpm-maven-plugin/map-params.html#artifact | |
--> | |
<artifact> | |
<classifiers> | |
<classifier/> | |
</classifiers> | |
</artifact> | |
</mapping> | |
</mappings> | |
<preinstallScriptlet> | |
<script>/etc/init.d/tomcat5 stop</script> | |
</preinstallScriptlet> | |
<postinstallScriptlet> | |
<script> | |
echo "removing ${apps.deploy.directory}" | |
rm -rf ${apps.deploy.directory} | |
echo "removing ${tomcat.work.directory}/*" | |
rm -rf ${tomcat.work.directory}/* | |
/etc/init.d/tomcat5 start | |
</script> | |
</postinstallScriptlet> | |
</configuration> | |
</plugin> | |
</plugins> | |
</pluginManagement> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment