RPM Deployment with Java Service Wrapper
Requirements
- Artifact must be deployed to a Maven repository. See Enterprise Maven Infrastructure for details.
- Jar project is assumed and mainClass must be set up. (Have not tried other artifact types.)
- Artifact does not need build-time configuration.
How
-
Generate Java Service Wrapper scripts with maven-appassembler-plugin
-
Generate rpm package with dependencies, scripts and configuration
-
Make the rpm user friendly
- Create a symlink in /etc/init.d/
- Set up runlevels
- chown and chmod according to $RUN_AS_USER system variable.
- Clean up when the package is removed.
See Example JSW and RPM for pom.xml configuration.
Resources
-
- rpm-maven-plugin
- http://svn.apache.org/repos/asf/archiva/trunk/archiva-jetty/pom.xml
- Jetty pom-xml (use rpm-plugin with init-scripts)
- rpm-maven-plugin with multiple modules
-
RedHat and RPM resources