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

fix: java21 build support #3602

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

svandenhoek
Copy link
Contributor

how to test:

  • Validate if it can be build correctly using Java17 & Java21 ("it worked on my machine" n>1)
    • Set $JAVA_HOME and run ./gradlew run

todo:

  • updated docs in case of new feature -> Consider adding a requirements page in docs with exact details instead of info being scattered in the documentation?
  • added tests
  • updated testplan to include a test for this fix, including ref to bug using # notation

Changelog:

  • Updated google-java-format to v1.22.0 due to error building in Java21:

    You are running Spotless on JVM 21. This requires google-java-format of at least 1.17.0 (you are using 1.15.0).

  • Moved targetCompatibility/sourceCompatibility from the root build.gradle to apps/build.gradle due to the following error:

    emx2:main: Could not resolve project :apps

  • Java version is now stored inside a single variable in the root instead of hardcoded in multiple locations (rootProject.ext.javaVersion).
  • The non-gradle file changes were done automatically due to the updated google-java-format.

Failed tests (local run through IntelliJ IDEA)

  • TestScriptTask -> testPython(): AssertionFailedError
  • WebApiSmokeTests:
    When testing everything in the project using jUnit, it gives the following error:
    java.lang.reflect.InaccessibleObjectException: Unable to make field final java.util.Map java.util.Collections$UnmodifiableMap.m accessible: module java.base does not "opens java.util" to unnamed module @3d680b5a
    However, when running WebApiSmokeTests.java directly (which uses a Gradle config instead of jUnit), 4 are skipped and 1 fails with AssertionFailedError

In both cases, the AssertionFailedError was present already in the master (didn't run all tests on the master, only the ones failed in the branch). Additionally, several tests in the branch were ignored by IDEA.

Copy link

sonarcloud bot commented Apr 4, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
65.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@svandenhoek
Copy link
Contributor Author

Quality Gate Failed Quality Gate failed

Failed conditions 65.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

As any changes to non-graddle files are purely automated formatting changes, this error should not matter.

@chinook25 chinook25 changed the title Fix/java21 build support fix: java21 build support Apr 17, 2024
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.

None yet

1 participant