[JAVA-2786] Upgrade Gradle to 4.5.1 Created: 18/Feb/18  Updated: 28/Oct/23  Resolved: 19/Feb/18

Status: Closed
Project: Java Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.7.0

Type: Task Priority: Minor - P4
Reporter: Farès Hassak Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10
Oracle JDK 9.0.4



 Description   

Hello,

Gradle failed with Oracle JDK 9.
See https://discuss.gradle.org/t/could-not-determine-java-version-from-9-0-1/24457

I can reproduce this error with Gradle 4.0.1:

D:\github\mongo-java-driver (master)
λ gradlew -v
 
FAILURE: Build failed with an exception.
 
* What went wrong:
Could not determine java version from '9.0.4'.
 
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

And it's better with Gradle 4.5.1:

D:\github\mongo-java-driver (build-with-java-9)
λ gradlew -v
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/Users/f.hassak/.gradle/wrapper/dists/gradle-4.5.1-bin/a5vbgfvpwtoqz8v2cdivxz28k/gradle-4.5.1/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
 
------------------------------------------------------------
Gradle 4.5.1
------------------------------------------------------------
 
Build time:   2018-02-05 13:22:49 UTC
Revision:     37007e1c012001ff09973e0bd095139239ecd3b3
 
Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          9.0.4 (Oracle Corporation 9.0.4+11)
OS:           Windows 10 10.0 amd64

For warning, see

https://github.com/gradle/gradle/issues/2995,
https://issues.apache.org/jira/browse/GROOVY-8339

Compile is success (but gradlew check failed...)

gradlew compileJava
 
BUILD SUCCESSFUL in 2s

Farès



 Comments   
Comment by Githook User [ 19/Feb/18 ]

Author:

{'email': 'ross.lawley@gmail.com', 'name': 'Ross Lawley', 'username': 'rozza'}

Message: Update build.gradle JAVA-2786
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/40e5a3d3480125f0a31b1472cc4dd53114ec982a

Comment by Githook User [ 19/Feb/18 ]

Author:

{'email': 'fares.hassak@gmail.com', 'name': 'Farès Hassak', 'username': 'fhassak'}

Message: JAVA-2786 : Upgrade Gradle to 4.5.1 (#455)
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/93b301ab2a605a44e4962d9ca438ff475b13c3ae

Comment by Farès Hassak [ 18/Feb/18 ]

Finally, build is success with gradlew clean check.

Generated at Thu Feb 08 08:58:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.