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
I am preparing a [wiki:Java/MavenRepoSpec Repository Specification] for further discussion.
The package maven-debian-helper is now in unstable but maven-site-plugin and surefire are still waiting in the new queue.
Features
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 -DdebianDir=$PWD/debian -DdebianPackage=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 [wiki:Java/MavenRepoSpec 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
- no ITP yet
cobertura
- no ITP yet