Bug 492208 - Hudson tests fail when running with Java 8
Summary: Hudson tests fail when running with Java 8
Status: NEW
Alias: None
Product: Hudson
Classification: Technology
Component: Core (show other bugs)
Version: 3.3.2   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Winston Prakash CLA
QA Contact: Geoff Waymark CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-21 15:55 EDT by Marc-André Laperle CLA
Modified: 2016-04-26 10:49 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2016-04-21 15:55:52 EDT
Using master as of today for the hudson.core repo.

Using Java 8 to build Hudson with maven results in an error:

$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: ******
Java version: 1.8.0_66-internal, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "4.2.0-35-generic", arch: "amd64", family: "unix"

$ mvn clean install

Results :

Tests in error: 
  hudson.model.PasswordParameterDefinitionEqualsHashCodeTest: Failed to transform class with name hudson.model.Hudson. Reason: java.io.IOException: invalid constant type: 18

Tests run: 356, Failures: 0, Errors: 10, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Hudson ............................................. SUCCESS [  0.532 s]
[INFO] Hudson :: Test Utilities ........................... SUCCESS [  2.067 s]
[INFO] Hudson :: Common Utilities ......................... SUCCESS [  2.629 s]
[INFO] Hudson :: CLI ...................................... SUCCESS [  1.058 s]
[INFO] Hudson :: Core ..................................... FAILURE [01:27 min]
[INFO] Hudson :: Inject (JSR-330 Strategy) ................ SKIPPED



However, if I run the build using Java 7, then it works. For example
$ JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ mvn clean install

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Comment 1 Bob Foster CLA 2016-04-25 12:46:12 EDT
Changed to enhancement request, as we don't build Hudson with Java 8 and there are known problems.
Comment 2 Marc-André Laperle CLA 2016-04-25 13:26:42 EDT
Perhaps you want to use Maven Enforcer to fail quickly if not running tests with Java 7?
https://maven.apache.org/enforcer/maven-enforcer-plugin/
Comment 3 Bob Foster CLA 2016-04-25 15:57:10 EDT
Probably should have done. Next release will probably be a bug fix release, so not appropriate to step the JDK, but we should ensure the build fails fast.
Comment 4 Eclipse Genie CLA 2016-04-25 17:34:59 EDT
New Gerrit change created: https://git.eclipse.org/r/71376