5

I am trying to build a debian package against Debian stretch. The debian/rules file is this:

#!/usr/bin/make -f

%:
        dh $@

override_dh_auto_build:
        mvn clean package

When I build it using pbuilder-buildpackage I get this build error:

mvn -e clean package
[INFO] Error stacktraces are turned on.
[ERROR] Could not create local repository at /nonexistent/.m2/repository -> [Help 1] 

How do I resolve this error?

1 Answer 1

3

Debian packages can’t rely on a home directory during builds. This is enforced in pbuilder with the /nonexistent home.

To fix this, you need to supply the appropriate options to Maven so that it places its repository in /tmp. But really, instead of doing that, you should build-depend on maven-debian-helper and let dh work its magic. Look at the Java packages in Debian for examples.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.