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.