Differences between revisions 23 and 24
Revision 23 as of 2009-04-01 22:47:14
Size: 3989
Comment:
Revision 24 as of 2009-07-28 14:37:58
Size: 4122
Comment:
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:

TODO: we should support dh in the future, see [[https://penta.debconf.org/dc9_schedule/events/418.en.html|Joey's Debconf9 talk]].

This is a discussion page for the pkg-java team's plan to use Maven to build Debian packages. If you just want to find out how to install and run Maven in Debian, you are probably looking at the wrong page. Instead run (from Lenny upwards!):

  • aptitude install maven2


Status

All core components are now in Debian and that means maven-debian-helper can be used to build Debian packages with Maven now.

The Repository Specification needs some minor updates.

Features

TODO: we should support dh in the future, see Joey's Debconf9 talk.

At http://svn.debian.org/wsvn/pkg-java/trunk/plexus-cdc/ you can find a package (plexus-cdc) that uses maven-debian-helper for building. With maven-debian-helper the debian/rules can be as short as

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/maven.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

JAVA_HOME := /usr/lib/jvm/java-6-openjdk

get-orig-source:
        sh -e debian/orig-tar.sh

and the Build-Depends are

Build-Depends: debhelper (>= 5), cdbs, openjdk-6-jdk, quilt, maven-debian-helper,
 libslf4j-java, libjdom1-java

Unfortunately we need a small patch for the pom.xml. Additional properties can be specified in the file debian/maven.properties which is read automatically if it exists.

Helper script

There is a script mvn-debian that allows using Maven offline without cdbs. Please use it only on your local system but never for building real Debian packages. It is used in the same way as maven itself:

$ mvn-debian clean package

maven-debian-plugin

This plugin provides some useful goals:

$ mvn-debian debian:install -Ddebian.dir=$PWD/debian -Ddebian.package=libfoo-java

This goal is automatically called by the cdbs snippet.

$ sudo mvn-debian debian:sysinstall
$ sudo mvn-debian debian:sysuninstall

installs or uninstalls a freshly built package into /usr/share/maven-repo/... without building a Debian package. It is not recommended to use those goals but they can be useful on occasion.

$ mvn-debian debian:resolve-none
$ mvn-debian debian:resolve-compile
$ mvn-debian debian:resolve-runtime
$ mvn-debian debian:resolve-test

The first goal reads your pom.xml file or all pom.xml files in a multimodule project and the parent poms and validates them. The other three goal resolve the compile, runtime, and test dependencies without building the package.

To test, or not to test

Tests are automatically built and run. The property

maven.test.failure.ignore = true

ignores the results of running the tests. The property

maven.test.skip = true

skips building and running the tests entirely which can be useful if some test dependencies are not packaged yet.

Plans

  • complete and discuss the Repository Specification

  • package all maven plugins and maven related packages with maven-debian-helper - that are packages matching doxia, maven, modello, plexus, and wagon
  • add pom files to 'important' packages like junit, easymock, jmock
  • add parent pom files to packages that are most appropriate
  • package jetty6 (already compiles successfully)

missing packages

The following packages are missing in Debian at least if we want to run the plugin's tests.

httpunit

cobertura

jetty6

See also

maven-repo-helper: This package provides helper scripts to include in existing packages the Maven POM and the jar in the Maven repository for Debian (/usr/share/maven-repo)


CategoryJava