java-docs-samples icon indicating copy to clipboard operation
java-docs-samples copied to clipboard

feat: add appengine maven sample for jdk 21

Open mpeddada1 opened this issue 1 year ago • 5 comments

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.xml parent set to latest shared-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 verify required
  • [ ] Lint passes: mvn -P lint checkstyle:check required
  • [ ] Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory 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

mpeddada1 avatar Aug 02 '24 19:08 mpeddada1

TODO: Once a new version of shared-configurations has been published, update the POM.

mpeddada1 avatar Aug 13 '24 18:08 mpeddada1

Please assign after PR is ready for review.

minherz avatar Aug 14 '24 14:08 minherz

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/

mpeddada1 avatar Aug 23 '24 22:08 mpeddada1

I agree, the most current version available is 1.2.0. Can you rebuild this PR using v1.2.0?

telpirion avatar Aug 26 '24 18:08 telpirion

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.

mpeddada1 avatar Aug 27 '24 14:08 mpeddada1