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.

  • Please check out these examples:

    http://github.com/tcurdt/jdeb/.../
  • saurabh_r_1
    Hii
    can you please give some sample project
    also how can i specify various options for dependency and other config files etc.???
  • 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.
  • Ludovic Claude
    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-m.../

    Cheers, Ludovic
blog comments powered by Disqus