Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use Java 17 #1315

Merged
merged 3 commits into from
Sep 29, 2023
Merged

Update to use Java 17 #1315

merged 3 commits into from
Sep 29, 2023

Conversation

lbergelson
Copy link
Contributor

This updates to use / require java 17.
I first tried to update the test module settings and ran into trouble. It seems like removing all of the test module settings completely works though. I set it to use the gradle junit platform settings which may be doing that in the background now.

Tests seem to run locally and on github without problems so I think it seems to be working.

I also update the versions of the github actions since they were using deprecated versions.

@lbergelson lbergelson requested review from jrobinso and davideby April 10, 2023 23:07
[group: 'com.sparkjava', name: 'spark-core', version: '2.2'],
[group: 'org.glassfish.jersey.core', name: 'jersey-common', version: '2.22.4']
)
testRuntimeOnly(
[group: 'org.junit.vintage', name:'junit-vintage-engine', version:'5.8.2']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test runtime dependency is the engine that runs junit4 tests since gradle seems to assume you're using 5 now.

@@ -243,32 +224,32 @@ tasks.distTar.enabled = false
tasks.startScripts.enabled = false

task createDistZip(type: Zip, dependsOn: createDist) {
archiveName = "IGV_${version}.zip"
archiveFileName = "IGV_${archiveVersion}.zip"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name changes are all to satisfy gradle deprecation complaints.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, looks good

@davideby
Copy link
Contributor

Looks good to me. Glad to see those hacks in compileTestJava are no longer necessary.

I'll note there a warning / non-fatal error when building on my Linux laptop:

Invalid Java installation found at '/usr/lib/jvm/openjdk-11' (Common Linux Locations). It will be re-checked in the next build. This might have performance impact if it keeps failing. Run the 'javaToolchains' task for more details.
Invalid Java installation found at '/usr/lib/jvm/openjdk-17' (Common Linux Locations). It will be re-checked in the next build. This might have performance impact if it keeps failing. Run the 'javaToolchains' task for more details.
Invalid Java installation found at '/usr/lib/jvm/openjdk-16' (Common Linux Locations). It will be re-checked in the next build. This might have performance impact if it keeps failing. Run the 'javaToolchains' task for more details.

I have no idea if Mac or Windows builds report the same.

This seems to be a Gradle bug that they claim is Closed. My take is that this doesn't affect anything and can be ignored at least for now, but you might want to keep an eye on it.

@hubutui
Copy link

hubutui commented Sep 6, 2023

Great job! But I got this error when I run gradle createDist on Linux:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':createDist'.
> Resolving dependency configuration 'default' is not allowed as it is defined as 'canBeResolved=false'.
  Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'default' should be resolved.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

./gradlew createDist gave me a similar error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':createDist'.
> Resolving dependency configuration 'default' is not allowed as it is defined as 'canBeResolved=false'.
  Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'default' should be resolved.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

* change to gradle 8.0.2
* minor changes to support java 17
* remove test module configuration and use gradle test platform instead
@jrobinso
Copy link
Contributor

@hubutui the "createDist" problem is fixed.

@jrobinso jrobinso merged commit 227302e into master Sep 29, 2023
2 checks passed
@jrobinso jrobinso deleted the lb_java17 branch September 29, 2023 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants