java-docs-samples
java-docs-samples copied to clipboard
feat: add appengine maven sample for jdk 21
Description
Fixes #<ISSUE-NUMBER>
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
- [x] I have followed Sample Format Guide
- [x]
pom.xmlparent set to latestshared-configuration - [x] Appropriate changes to README are included in PR
- [ ] These samples need a new API enabled in testing projects to pass (let us know which ones)
- [ ] These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
- [ ] Tests pass:
mvn clean verifyrequired - [ ] Lint passes:
mvn -P lint checkstyle:checkrequired - [ ] Static Analysis:
mvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only - [ ] This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
- [ ] This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
- [ ] Please merge this PR for me once it is approved
TODO: Once a new version of shared-configurations has been published, update the POM.
Please assign after PR is ready for review.
Next error:
[ERROR] The project com.example.appengine:helloworld-jdk21:1.0-SNAPSHOT (/tmpfs/src/github/java-docs-samples/appengine-java21/helloworld/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.example.appengine:helloworld-jdk21:1.0-SNAPSHOT: Could not find artifact com.google.cloud.samples:shared-configuration:pom:1.2.1 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 26, column 11 -> [Help 2]
It looks like v1.2.1 is not available on maven central: https://repo1.maven.org/maven2/com/google/cloud/samples/shared-configuration/
I agree, the most current version available is 1.2.0. Can you rebuild this PR using v1.2.0?
I agree, the most current version available is 1.2.0. Can you rebuild this PR using v1.2.0?
Thanks for the question, @telpirion. v1.2.0 brings in an older version of the jacoco plugin (v0.8.7) which isn't compatible with java 21 and results in the following issue:
[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.7:report (report) on project helloworld-jdk21: An error has occurred in JaCoCo report generation.: Error while creating report: Error while analyzing /usr/local/google/home/mpeddada/java-docs-samples/appengine-java21/helloworld/target/helloworld-jdk21-1.0-SNAPSHOT/WEB-INF/classes/com/example/appengine/java21/HelloAppEngine.class. Unsupported class file major version 65
We are looking for v1.2.1 because it contains an update of jacoco 0.8.12 which supports java 21 (https://github.com/GoogleCloudPlatform/java-repo-tools/releases/tag/v1.2.1). However, it looks like the github release was published but the actual release job of the artifact to maven central didn't get kicked off.