Bug#910093: maven-compiler-plugin: tests fail due to hardcoded junit jar path and missing JAVA_HOME

Tiago Stürmer Daitx tiago.daitx at canonical.com
Tue Oct 2 17:57:19 BST 2018


Package: maven-compiler-plugin
Version: 3.8.0-1
Severity: minor

Dear Maintainer,

Currently maven-compiler-plugin tests are failing due to 2 different
reasons:
1. Some tests depend on JAVA_HOME being set
2. The junit jar file is hardcoded to version 3.8.1

Excerpt of the buildlog with the test failures:
[ERROR] Tests run: 12, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 8.983 s <<< FAILURE! - in org.apache.maven.plugin.compiler.CompilerMojoTestCase
[ERROR] testCompilerBasic(org.apache.maven.plugin.compiler.CompilerMojoTestCase)  Time elapsed: 5.642 s  <<< ERROR!
org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerBasic(CompilerMojoTestCase.java:99)

[ERROR] testCompilerIncludesExcludes(org.apache.maven.plugin.compiler.CompilerMojoTestCase)  Time elapsed: 0.784 s  <<< ERROR!
org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerIncludesExcludes(CompilerMojoTestCase.java:190)

[ERROR] testCompileSkipMain(org.apache.maven.plugin.compiler.CompilerMojoTestCase)  Time elapsed: 0.369 s  <<< ERROR!
org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompileSkipMain(CompilerMojoTestCase.java:359)

[ERROR] testCompilerFork(org.apache.maven.plugin.compiler.CompilerMojoTestCase)  Time elapsed: 0.163 s  <<< ERROR!
org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerFork(CompilerMojoTestCase.java:215)
Caused by: org.codehaus.plexus.compiler.CompilerException: Error while executing the external compiler.
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerFork(CompilerMojoTestCase.java:215)
Caused by: org.codehaus.plexus.util.cli.CommandLineException: Error while executing process.
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerFork(CompilerMojoTestCase.java:215)
Caused by: java.io.IOException: Cannot run program "bin/javac" (in directory "/<<PKGBUILDDIR>>"): error=2, No such file or directory
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerFork(CompilerMojoTestCase.java:215)
Caused by: java.io.IOException: error=2, No such file or directory
	at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerFork(CompilerMojoTestCase.java:215)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   CompilerMojoTestCase.testCompileSkipMain:359 ? CompilationFailure Compilation ...
[ERROR]   CompilerMojoTestCase.testCompilerBasic:99 ? CompilationFailure Compilation fai...
[ERROR]   CompilerMojoTestCase.testCompilerFork:215 ? MojoExecution Fatal error compilin...
[ERROR]   CompilerMojoTestCase.testCompilerIncludesExcludes:190 ? CompilationFailure Com...
[INFO]
[ERROR] Tests run: 12, Failures: 0, Errors: 4, Skipped: 0
[INFO]
[ERROR] There are test failures.


Expected result with passing tests:
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 51.216 s - in org.apache.maven.plugin.compiler.CompilerMojoTestCase
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0


I will be attaching the debdiff with a fix as soon as I have a bug
number to reference to in the changelog.

Regards,
Tiago

-- System Information:
Debian Release: buster/sid
  APT prefers cosmic
  APT policy: (500, 'cosmic'), (400, 'cosmic-proposed')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-7-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled



More information about the pkg-java-maintainers mailing list