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

Gradle and transitive dependencies



Hello,

I'm trying to update the mongo-java-driver package to 3.3.0, using
gradle-debian-helper.

I've got a package which builds, now I'm trying to run the tests with

dh_auto_build --buildsystem=gradle -- check

Currently, the tests fail with:

----

    Replacing org.codenarc:CodeNarc:jar:0.24  ->
org.codenarc:CodeNarc:jar:debian
    Ignoring org.sonatype.oss:oss-parent:jar:debian
    Passing through org.codehaus.groovy:groovy:jar:debian
    Passing through org.codehaus.groovy:groovy-xml:jar:debian
    Passing through org.codehaus.groovy:groovy-ant:jar:debian
    Passing through org.gmetrics:GMetrics:jar:debian
    Passing through junit:junit:jar:debian
    Passing through org.codehaus.groovy:groovy-groovydoc:jar:debian
    Passing through org.apache.ant:ant-antlr:jar:debian
    Passing through org.apache.ant:ant-parent:jar:debian
    Passing through org.apache.ant:ant-junit:jar:debian
    Passing through org.codehaus.groovy:groovy-templates:jar:debian
:bson:codenarcTest (Thread[main,5,main]) completed. Took 0.052 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':bson:codenarc'.
> Could not resolve junit:junit:debian.
  Required by:
      org.mongodb:bson:3.3.0 > org.codenarc:CodeNarc:0.24
   > No cached version of junit:junit:debian available for offline mode.
   > No cached version of junit:junit:debian available for offline mode.

* Try:
Run with --debug option to get more log output.
----

Looking in /usr/share/maven-repo/junit/junit/, I see that there is no
'debian' version of junit, but there are versions:

3.8.2  3.x  4.12  4.x

There's a cryptic comment from the gradle-debian-helper README.txt [0]
which says

"Transitive dependencies with a non generic version (neither 'debian' nor '.x')
  must be added to debian/maven.rules in order to preserve the version
  (with a rule like: org.foo bar * * * *)"

So I've created a debian/maven.rules file and, separately tried the
following rules:

junit junit * * * *
junit junit * s/debian/4.x/ * *
junit junit * s/.*/4.x/ * *

None of these seem to have any effect though.

My questions are:

1) Why doesn't junit have a 'debian' version? Is this just an
oversight or a deliberate decision?

2) What is the correct way to handle this situation?

Thanks.

Christopher

[0] https://anonscm.debian.org/cgit/pkg-java/gradle-debian-helper.git/tree/README.txt


Reply to: