Bug#664641: libsurefire-java: Surefire does not correctly detect JUnit 4 from Debian Maven Repository

James Page james.page at ubuntu.com
Mon Mar 19 14:51:52 UTC 2012


Package: libsurefire-java
Version: 2.10-2
Severity: normal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I hit this when debugging the FTBFS for libcommons-lang3-java.

This package depends on JUnit4; Tweaking the Maven debug level up 
with -X revealed that surefire was exectuing the tests with the JUnit3
provider which was the cause of the test failures.

Surefire looks at the JUnit artifact versioning on startup and makes
an intelligent decision about which version of the provider to use:

{{{
if the JUnit version in the project >= 4.7 and the parallel attribute has ANY value
    use junit47 provider
if JUnit >= 4.0 is present
    use junit4 provider
else
    use junit3.8.1
}}}

See http://maven.apache.org/plugins/maven-surefire-plugin/examples/junit.html

However the 4.x artifact in /usr/share/maven-repo/junit/junit fails this test
and surefire reverts to 3.x behaviour.

I worked around this by 

a) Mapping the JUnit artifact directly to the current 4.8.2 artifact in 
/usr/share/maven-repo.

b) Forcing the provider by specifying it through plugin dependencies.

Neither of these is ideal but b) is less brittle.

Surefire uses the standard Maven Versioning classes to determing whether 
the JUnit presented is in specific ranges - see 

maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java

for details of how this works.

I'll work on something to fix this up - it should be relatively easy to detect the 4.x string
in the version (we know its >= 4.7) and fixup the behaviour.

- -- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-18-generic (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libsurefire-java depends on:
ii  libmaven-common-artifact-filters-java  1.2-1

Versions of packages libsurefire-java recommends:
ii  junit   3.8.2-8
ii  junit4  4.10-1

libsurefire-java suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJPZ0gIAAoJEL/srsug59jDNfwP/3g+I58pkajieAuSC7nCW0u3
fbiOWgsz6pNq4BzVDXjUJ+grt9bSBDFOtPfn+oTmOrdSrWPyhgyljBTc8gZFrFpR
fpTchoXtKVcwvSeFxBrCZAvJh0+WmmWA09Etvo1Q+vJP3aafsXTIK8WJgyHSxoAv
6bV+cJFqZ64+kW9WFiB49DAs/3z0Xd4+LzNjnG6sSOmukVv85ACwd/e4BQbgws8v
3LhVMMdO+AjNJZ73e7h1igIMBgsZvBEJHWkF4FgAvedvrOxuCGU4HCnaZxQKX2Uo
ifJ86I7gjYRFBuuthjfhbg96xu3A7ocOdSchVG9/7yIBAPUzfea/rbry2zAEzpft
G/wfJV+u4SWXk+Lg8295c0o1kbFCm98BUZdeOtZPQHLDgmSpkdEP6mHbjJBMWNkV
CrU4rFv24jsVJ4rDV1kpaqV00K5SUCLUmnHBY5wN7NNwgyzJcqgTdsV/Mj0uK+ek
6C2lneW/MVZKkJClyQIpEZDA7q8FmZlAu+VE923ZWKIQxsU956eUgx4FzW4m19ag
gehLQWQVytJmQ4/PAuKLiEBdVBLOthexy5KS7rFbGaL+MsT6536WPqxAu6c6uJV3
nZ/mh4mRzhXzU1Jm3aU252ejTCS4Mg4lxSFYqsScElRIYMhW6rsC1hyilAK4OyqJ
7E/rLPRZbrjbmtODuOaD
=Nq0/
-----END PGP SIGNATURE-----





More information about the pkg-java-maintainers mailing list