header

Torsten Curdt’s weblog

Building Debian packages with Maven

How do you distribute and deploy you java applications and libraries? Especially if you are using Debian/Ubuntu machines the desire to just install them like any other software with “apt-get install” comes just with that. But how do you integrate this with you build system? You could of course have the debian tools installed on the build bot and have that generate the deb. But wouldn’t it be nice to have your java build system take care of that too? Cross platform packaging is why I started jdeb. What started out as a little library with an ant task has now gotten a bit more flexible. Today I am happy to announce that with the new release of 0.3 there is also a maven plugin available. Just add this to your POM and your are good to go. When you call “mvn install” you will also find the Debian archive in the target directory.

<plugin>
    <artifactId>jdeb</artifactId>
    <groupId>org.vafer</groupId>
    <version>0.3</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>deb</goal>
            </goals>
        </execution>
    </executions>
</plugin>

You can even get the appropriate changes file generated. Please see the documentation for further details and let me know if you have any questions. For the ones upgrading from 0.2 - it should be (more or less) a drop in replacement. For more details on the changes see the project website.

2 Responses to “Building Debian packages with Maven”

  1. Ludovic Claude said, on 1. November 2007 at 0:04

    Hello Torsten, your plugin looks good, but I wonder if you were aware of a similar project with the same goals:
    http://mojo.codehaus.org/deb-maven-plugin/

    Cheers, Ludovic

  2. tcurdt said, on 1. November 2007 at 1:32

    Hey, Ludovic …yes, I am. The big problem with that plugin is…

    “This plugin depends on the presence of chmod, dpkg, and fakeroot. Consequently, it is a Debian (or Debian variant) specific plugin as it relies on fakeroot being avaiable on the PATH”

    It relies on native code. One of the main goals of jdeb is to provide a cross-platform way of building artifacts. I am developing under OSX, many developers at work are using windows and the build bot is running on linux. I don’t want people to bother getting those tools installed for a java project.

Leave a Reply

Please copy the string TZ7htl to the field below: