Generate rpm with redline (java) and maven 18 Jun 2015
A quick post as a simple tutorial to generate a rpm using redline and maven.
Simply create a Main class, inside the main method here is some basic info
You can add dependency on certain commands : example
You can also add some pre-install script or post-install script and files too.
Specify jar for packaging. Then add the dependencies. In your pom you will need redline, slf4j and a logger.
To build an executable jar add the following plugin to your pom. Note the
jar-with-dependencies that will create a second jar with all the dependencies so that it will be easier to execute the jar
mvn clean install this will create your jar in your target repository.
Go to the target directory.
#Generate the rpm
java -jar yourArtefact-with-dependencies.jar
This will create the rpm
Then to install the rpm (on linux), you may have to use sudo …
rpm -Uvh yourrpm.rpm
Now you can go on by adding some preInstall scripts for example !