I'm trying to adjust my build procedure to produce a standalone executable. There are a few tools that do this and Packr seems like the perfect one. Also as far as I can tell it is officially supported my maven.
After spending roughly an epoch of googlin' I haven't had any luck finding a simple maven XML example of a packr build step. Also I'm very new to Maven which makes this more complicated. It seems to me though, that there should be a fairly standard XML block where only a few jar names would need to be changed to get it working.
I'm also working in eclipse and trying to build executables for windows and linux.
Packr: https://github.com/libgdx/packr
Packr in Maven: https://mvnrepository.com/artifact/com.badlogicgames.packr/packr
I couldn't find any maven plugin for this either.
There is version 1.2 of packr in maven central, but bear in mind this is now a fairly old version (https://github.com/libgdx/packr/issues/58).
You can use the standard exec-maven-plugin to draw upon the packr 1.2 dependency and then run it (see http://www.mojohaus.org/exec-maven-plugin/examples/example-exec-using-plugin-dependencies.html).
The relevant fragment in the pom.xml build file might look something like:
If you've already got a
<build>and<plugins>section in your pom.xml, then just take the<plugin>bit and put it in there.The json config file might look something like:
One thing to be aware of, packr 1.2 seems to delete the 'outdir' directory, so be careful to use something other than the 'target' directory.
In case it helps, I personally ended up packaging for windows using launch4j with the launch4j-maven-plugin and packaging for linux/mac using Oracle's standard javapackager tool via the javafx-maven-plugin. I'd link to those two but StackOverflow tells me I don't have enough rep to include more than two links.