[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to package maven-based packages without network access?



Hi Rogerio,

The strategy adopted is to run Maven in offline mode and pick the
artifacts from the local repository in /usr/share/maven-repo. This
repository is populated by the installed packages. This solves the
network access issue.

The other issue is the mismatch between the version of the artifacts
required to build a project and the version of the artifacts actually
packaged, since Debian ships usually only one version for a given
distribution. The solution here is to rewrite the pom.xml file at build
time to point to the version available in Debian.

All of this magic is performed by maven-debian-helper and
maven-repo-helper. To create a package from a Maven project you start by
running the mh_make tool in the upstream source directory. You'll be
asked several questions about the dependencies and it will generate a
package stub.

Some further reading on this topic:

https://wiki.debian.org/Java/MavenRepoSpec
https://wiki.debian.org/Java/MavenRepoHelper


Alternatively, if you just want to package a Maven project for your
private use with no intent to upload it into the Debian archive I
recommend using the jdeb Maven plugin, that's much simpler.

https://github.com/tcurdt/jdeb

Emmanuel Bourg


Le 28/01/2014 07:43, rbrito@ime.usp.br a écrit :
> Hi there.
> 
> First, some introduction here: I am a novice (*very* novice, still in my
> baby steps) regarding programming in Java.
> 
> That being said, from my Debian-Maintainer PoV, I would like to, sometimes,
> package (or help packaging, or reviewing) packages that use maven as the
> build tool.
> 
> Unfortunately, I see that Maven downloads all the dependencies from the
> network at build time and, in the Debian spirit, I would like to declare
> build dependencies and convince maven to use the installed dependencies.
> 
> What is the approved/recommended way of doing this?
> 
> 
> Thanks in advance,
> Rogério Brito.
> 
> 
> P.S.: Of course, if something is not packaged, I may be willing (depending
> on how much knowledge is needed---I am a newbie, after all) to package the
> dependencies to have everything self-contained.
> 


Reply to: