Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distributing a jar

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.

like image 581
EricR Avatar asked Nov 05 '22 10:11

EricR


1 Answers

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.

  • http://www.mojohaus.org/deb-maven-plugin/using-deb.html

...
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>deb-maven-plugin</artifactId>
    <configuration>
        <description>A test project</description>
        <maintainer>Tim OBrien &lt;[email protected]&gt;</maintainer>
        <section>libs</section>
        <priority>optional</priority>     
        <architecture>all</architecture>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>deb</goal>
            </goals>
        </execution>
    </executions>
</plugin>
...
like image 186
miku Avatar answered Nov 11 '22 03:11

miku