Skip to content

Commit 7b07ebc

Browse files
committed
Update JREs to 17.0.15+6
1 parent 9c91f2c commit 7b07ebc

File tree

3 files changed

+99
-15
lines changed

3 files changed

+99
-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 latest releases**: Query Adoptium/Temurin GitHub API to find the latest JRE 17 releases across multiple recent releases to ensure all architectures are covered
11+
2. **Handle architecture differences**: Different architectures may have different latest available versions
12+
3. **Update version properties**: Update JRE version properties in pom.xml (lines 58-62) for each architecture
13+
4. **Update download URLs**: Update download URLs for all platform profiles
14+
5. **Fetch and verify hashes**: Download and update SHA256 hashes for verification
15+
6. **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
16+
17+
## Platforms supported:
18+
- Linux x64: `OpenJDK17U-jre_x64_linux_hotspot_{version}.tar.gz`
19+
- Linux aarch64: `OpenJDK17U-jre_aarch64_linux_hotspot_{version}.tar.gz`
20+
- macOS x64: `OpenJDK17U-jre_x64_mac_hotspot_{version}.tar.gz`
21+
- macOS aarch64: `OpenJDK17U-jre_aarch64_mac_hotspot_{version}.tar.gz`
22+
- Windows x64: `OpenJDK17U-jre_x64_windows_hotspot_{version}.zip`
23+
24+
## Usage:
25+
```
26+
/update-jres # Uses latest version (default)
27+
/update-jres latest # Same as above
28+
/update-jres 17.0.15+6 # Uses specific version
29+
```
30+
31+
## Implementation Details:
32+
33+
When using "latest" (default behavior), the command will:
34+
35+
1. **Query multiple releases**: Since not all architectures are available in every release, query the first 10-15 recent releases from the Adoptium API
36+
2. **Find best version per architecture**: For each architecture, find the latest available version across those releases
37+
3. **Handle missing architectures**: If an architecture isn't found in recent releases, fall back to querying release pages or specific known-good versions
38+
4. **Update properties individually**: Update each architecture's version property in pom.xml with its specific latest version
39+
5. **Download and verify**: For each architecture/version combination:
40+
- Construct download URL
41+
- Fetch SHA256 hash from corresponding .sha256.txt file
42+
- Update Maven profile with new URL and hash
43+
6. **Validate all changes**: Ensure all profiles have valid URLs and hashes
44+
7. **Commit**: Commit with a summary of the changes. The commit title should be short but include the new version(s)
45+
46+
The command handles the reality that Adoptium releases don't always include all architectures simultaneously, ensuring each platform gets the newest available JRE 17 version.

CLAUDE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Claude Commands for SonarScanner CLI
2+
3+
## Update JREs
4+
5+
Updates all bundled JREs to the latest available JRE 17 version across all platforms (Linux x64/aarch64, macOS x64/aarch64, Windows x64) 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+
**Examples:**
17+
```
18+
/update-jres # Automatically finds and uses latest JRE 17
19+
/update-jres latest # Same as above
20+
/update-jres 17.0.15+6 # Use specific version
21+
```
22+
23+
**What it does:**
24+
1. **Auto-discovers latest versions**: Queries Adoptium GitHub API across multiple recent releases to find the latest JRE 17 version for each architecture
25+
2. **Handles architecture differences**: Different architectures may have different latest versions available
26+
3. **Updates version properties**: Updates architecture-specific version properties in pom.xml (lines 58-62)
27+
4. **Updates download URLs**: Updates platform-specific download URLs
28+
5. **Fetches and updates SHA256 hashes**: Downloads and verifies SHA256 hashes for each platform
29+
6. **Updates Maven profiles**: Updates all platform-specific distribution profiles
30+
31+
**Supported platforms:**
32+
- Linux x64
33+
- Linux aarch64
34+
- macOS x64
35+
- macOS aarch64
36+
- Windows x64
37+
38+
The command automatically handles the Adoptium/Temurin download URLs, verification hashes, and the reality that not all architectures are released simultaneously.

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)