views:

47

answers:

2
+3  Q: 

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.

+1  A: 

This project might make it easier for you.

thelost
+1  A: 

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;[email protected]&gt;</maintainer>
        <section>libs</section>
        <priority>optional</priority>     
        <architecture>all</architecture>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>deb</goal>
            </goals>
        </execution>
    </executions>
</plugin>
...
The MYYN