Skip to content

Commit c688b47

Browse files
committed
Update JREs to 17.0.15+6
1 parent 92ed13c commit c688b47

File tree

3 files changed

+81
-15
lines changed

3 files changed

+81
-15
lines changed

.claude/update-jres.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Update JREs Command
2+
3+
Updates all bundled JREs in the sonar-scanner-cli project to the latest available JRE 17 version for each architecture by automatically querying the Adoptium API.
4+
5+
## Arguments
6+
- `latest` (default) - automatically finds the latest JRE 17 version for each architecture
7+
- `<version>` - specify exact version like `17.0.15+6`
8+
9+
## Steps performed:
10+
1. **Fetch release metadata**: Query Adoptium/Temurin API to find the releases details
11+
2. **Update version properties**: Update JRE root directory name in the pom.xml `<properties>` section for each architecture
12+
3. **Update download URLs**: Update download URLs and SHA256 hashes for all platform profiles
13+
4. **Validate changes**: Ensure all Maven profiles are properly updated, then run `mvn clean verify -P<list of all architecture-specific profile ids>` to be sure there are no errors
14+
15+
## Platforms supported:
16+
- Linux x64: `OpenJDK17U-jre_x64_linux_hotspot_{version}.tar.gz`
17+
- Linux aarch64: `OpenJDK17U-jre_aarch64_linux_hotspot_{version}.tar.gz`
18+
- macOS x64: `OpenJDK17U-jre_x64_mac_hotspot_{version}.tar.gz`
19+
- macOS aarch64: `OpenJDK17U-jre_aarch64_mac_hotspot_{version}.tar.gz`
20+
- Windows x64: `OpenJDK17U-jre_x64_windows_hotspot_{version}.zip`
21+
22+
## Usage:
23+
```
24+
/update-jres # Uses latest version (default)
25+
/update-jres latest # Same as above
26+
/update-jres 17.0.15+6 # Uses specific version
27+
```
28+
29+
## Implementation Details:
30+
31+
Don't use the GitHub API, as there is an Adoptium API:
32+
33+
When using "latest" (default behavior), the command will:
34+
35+
1. **Query the latest release metadata**: Use the Adoptium API: `curl -X 'GET' 'https://api.adoptium.net/v3/assets/latest/17/hotspot?image_type=jre&vendor=eclipse' -H 'accept: application/json'`
36+
2. **Handle missing architectures**: If an architecture isn't found in the latest release, it might be that the release process is in progress. In this case suggest staying on the previous version.
37+
3. **Read metadata from the JSON**: For each architecture/version combination:
38+
- Read download URL from the JSON metadata (`binary.package.link`)
39+
- Read SHA256 hash from from the JSON metadata (`binary.package.checksum`)
40+
41+
When using a specific version, the command will:
42+
43+
1. **Query the release metadata**: Use the Adoptium API: `curl -X 'GET' 'https://api.adoptium.net/v3/assets/version/<version URL encoded>?image_type=jre&page=0&page_size=10&project=jdk&release_type=ga&semver=false&sort_method=DEFAULT&sort_order=DESC&vendor=eclipse' -H 'accept: application/json'`
44+
2. **Read metadata from the JSON**: For each architecture/version combination:
45+
- Read download URL from the JSON metadata (`binaries.package.link`)
46+
- Read SHA256 hash from from the JSON metadata (`binaries.package.checksum`)

CLAUDE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Claude Commands for SonarScanner CLI
2+
3+
## Update JREs
4+
5+
Help updating all bundled JREs to the latest available JRE 17 version, or to a specific version, by automatically querying the Adoptium API.
6+
7+
**Command:** `/update-jres`
8+
9+
**Usage:**
10+
```
11+
/update-jres # Uses latest version (default)
12+
/update-jres latest # Same as above
13+
/update-jres 17.0.15+6 # Uses specific version
14+
```
15+
16+
**What it does:**
17+
1. **Get JREs metadata**: Queries Adoptium API to get JREs metadata
18+
2. **Updates version properties**: Updates architecture-specific dirname properties in pom.xml
19+
3. **Updates download URLs**: Updates platform-specific download URLs
20+
4. **Updates SHA256 hashes**: Updates SHA256 hashes for each platform

pom.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
<!-- configuration for assembly of distributions -->
5656
<unpack.dir>${project.build.directory}/unpack</unpack.dir>
5757
<scanner.jar>${project.build.finalName}.jar</scanner.jar>
58-
<jre.dirname.linux.aarch64>jdk-17.0.13+11-jre</jre.dirname.linux.aarch64>
59-
<jre.dirname.linux.x64>jdk-17.0.13+11-jre</jre.dirname.linux.x64>
60-
<jre.dirname.macosx.aarch64>jdk-17.0.13+11-jre/Contents/Home</jre.dirname.macosx.aarch64>
61-
<jre.dirname.macosx.x64>jdk-17.0.13+11-jre/Contents/Home</jre.dirname.macosx.x64>
62-
<jre.dirname.windows>jdk-17.0.13+11-jre</jre.dirname.windows>
58+
<jre.dirname.linux.aarch64>jdk-17.0.15+6-jre</jre.dirname.linux.aarch64>
59+
<jre.dirname.linux.x64>jdk-17.0.15+6-jre</jre.dirname.linux.x64>
60+
<jre.dirname.macosx.aarch64>jdk-17.0.15+6-jre/Contents/Home</jre.dirname.macosx.aarch64>
61+
<jre.dirname.macosx.x64>jdk-17.0.15+6-jre/Contents/Home</jre.dirname.macosx.x64>
62+
<jre.dirname.windows>jdk-17.0.15+6-jre</jre.dirname.windows>
6363

6464
<!-- Release: enable publication to Bintray -->
6565
<artifactsToPublish>${project.groupId}:${project.artifactId}:zip,${project.groupId}:${project.artifactId}:zip:linux-x64,${project.groupId}:${project.artifactId}:zip:linux-aarch64,${project.groupId}:${project.artifactId}:zip:windows-x64,${project.groupId}:${project.artifactId}:zip:macosx-x64,${project.groupId}:${project.artifactId}:zip:macosx-aarch64,${project.groupId}:${project.artifactId}:json:cyclonedx</artifactsToPublish>
@@ -291,10 +291,10 @@
291291
<goal>wget</goal>
292292
</goals>
293293
<configuration>
294-
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jre_x64_linux_hotspot_17.0.13_11.tar.gz</url>
294+
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_linux_hotspot_17.0.15_6.tar.gz</url>
295295
<unpack>true</unpack>
296296
<outputDirectory>${unpack.dir}/linux-x64</outputDirectory>
297-
<sha256>4086cc7cb2d9e7810141f255063caad10a8a018db5e6b47fa5394c506ab65bff</sha256>
297+
<sha256>aaed740c38ff1e87a4b920f9deb165d419d9fdf23f423740d2ecb280eeab9647</sha256>
298298
</configuration>
299299
</execution>
300300
</executions>
@@ -364,10 +364,10 @@
364364
<goal>wget</goal>
365365
</goals>
366366
<configuration>
367-
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jre_aarch64_linux_hotspot_17.0.13_11.tar.gz</url>
367+
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_aarch64_linux_hotspot_17.0.15_6.tar.gz</url>
368368
<unpack>true</unpack>
369369
<outputDirectory>${unpack.dir}/linux-aarch64</outputDirectory>
370-
<sha256>97c4fb748eaa1292fb2f28fec90a3eba23e35974ef67f8b3aa304ad4db2ba162</sha256>
370+
<sha256>c89467f543bd434b71f3b748adeeeb1b2692f90242824b78205be1ae72ba385f</sha256>
371371
</configuration>
372372
</execution>
373373
</executions>
@@ -437,10 +437,10 @@
437437
<goal>wget</goal>
438438
</goals>
439439
<configuration>
440-
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jre_x64_windows_hotspot_17.0.13_11.zip</url>
440+
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.zip</url>
441441
<unpack>true</unpack>
442442
<outputDirectory>${unpack.dir}/windows-x64</outputDirectory>
443-
<sha256>11a61a94d383e755b08b4e5890a13d148bc9f95b7149cbbeec62efb8c75a4a67</sha256>
443+
<sha256>4380136495b1aebf10593a94c98babd632155e5ace3fa5b1a1a3b79d6fbe2e99</sha256>
444444
</configuration>
445445
</execution>
446446
</executions>
@@ -510,10 +510,10 @@
510510
<goal>wget</goal>
511511
</goals>
512512
<configuration>
513-
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jre_x64_mac_hotspot_17.0.13_11.tar.gz</url>
513+
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_x64_mac_hotspot_17.0.15_6.tar.gz</url>
514514
<unpack>true</unpack>
515515
<outputDirectory>${unpack.dir}/macosx-x64</outputDirectory>
516-
<sha256>bf9faf4540001a251e6bfb52b99c7ec5b1f36d3ebe94e104f61a30f173ba8c78</sha256>
516+
<sha256>38f7bb3faaa3aec90290e6dd912a050cc895ee2aa8fb9d8ea6aac86822bb108b</sha256>
517517
</configuration>
518518
</execution>
519519
</executions>
@@ -583,10 +583,10 @@
583583
<goal>wget</goal>
584584
</goals>
585585
<configuration>
586-
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jre_aarch64_mac_hotspot_17.0.13_11.tar.gz</url>
586+
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jre_aarch64_mac_hotspot_17.0.15_6.tar.gz</url>
587587
<unpack>true</unpack>
588588
<outputDirectory>${unpack.dir}/macosx-aarch64</outputDirectory>
589-
<sha256>a886b8f2a50eca2e59b45ea59f5a2e8e9d27ff5b5b3b069443a70cda7f27c907</sha256>
589+
<sha256>2eb9548fbed1031355ca11a35b5a297e9872edd1dafacb40294f0c1a6677bbfb</sha256>
590590
</configuration>
591591
</execution>
592592
</executions>

0 commit comments

Comments
 (0)