Question

I'm distributing a jar file, with associated libraries, media, documentation, etc. I would like to create a simple deb/rpm package for linux users, and I would also like to distribute this for windows. What is the best way to go about setting up the jar to play nicely with debs? Every deb file I've looked at so far has been c/c++ with a makefile, which isn't at all helpful. How do I package my java jar for distribution?

Edit It would be nice if this could automate the placement of conf files in /etc/project-name/sample.conf, icons in /usr/share, etc.

Was it helpful?

Solution

The Maven 2 DEB Plugin can be used to produce a Debian package from any project that can be packaged as a JAR. Debian packages can be used on most Debian-based Linux Disributions including Ubuntu and Knoppix.


...
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>deb-maven-plugin</artifactId>
    <configuration>
        <description>A test project</description>
        <maintainer>Tim OBrien &lt;tobrien@discursive.com&gt;</maintainer>
        <section>libs</section>
        <priority>optional</priority>     
        <architecture>all</architecture>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>deb</goal>
            </goals>
        </execution>
    </executions>
</plugin>
...

OTHER TIPS

This project might make it easier for you.

For packaging your Java application as a Debian package I would recommend jdeb. It's very flexible and integrates well with Maven and Ant.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top