Skip to content

Commit 0e72508

Browse files
committed
Update RESTHeart plugin skeleton for RESTHeart 9
1 parent 58841d4 commit 0e72508

File tree

5 files changed

+36
-22
lines changed

5 files changed

+36
-22
lines changed

.claude/settings.local.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"mcp__acp__Edit",
5+
"mcp__acp__Bash"
6+
]
7+
}
8+
}

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ Check also the [RESTHeart Greetings Services Tutorial](https://restheart.org/doc
1010

1111
## Requirements
1212

13-
- **Java 24 (or GraalVM 24)**: Required to compile and run the plugin.
13+
- **GraalVM 25 (or Java 25)**: Required to compile and run the plugin.
1414
- **Docker**: Used to containerize and run RESTHeart.
1515

16-
Note: for RESTHeart 8.0.0 to 8.9.x, use Java 21 (or GraalVM 21)
17-
18-
NOTE: For a known bug affecting RESTHeart 8.10, 8.11 and 8.12 (after migration to Java 24), for native build use RESTHeart 8.13+
16+
NOTE: This works for RESTHeart 9+, for RESTHeart 8.x, use the git tag `8.x`
1917

2018
---
2119

@@ -169,13 +167,13 @@ Native images provide faster startup and lower memory usage.
169167

170168
Install GraalVM using [SDKMAN](https://sdkman.io/):
171169
```bash
172-
sdk install java 24.0.2-graalce
173-
sdk use java 24.0.2-graalce
170+
sdk install java 25.0.1-graalce
171+
sdk use java 25.0.1-graalce
174172
```
175173

176174
### Build Commands
177175

178-
**Quick build** (faster, default):
176+
**Quick build** (faster, deault):
179177

180178
Maven:
181179
```bash
@@ -368,7 +366,7 @@ Gradle provides faster builds through:
368366
Edit `gradle.properties` to customize:
369367
```properties
370368
# RESTHeart version
371-
restheart.version=[8.12.0,8.1000.0)
369+
restheart.version=[9.0.0,9.1000.0)
372370

373371
# Native image settings
374372
native.gc=--gc=serial

build.gradle

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ group = 'org.restheart'
1919
version = '1.0.0-SNAPSHOT'
2020
description = 'restheart-plugin-skeleton'
2121

22-
def restheartVersion = '[8.12.0,8.1000.0)'
22+
def restheartVersion = [9.0.0,9.1000.0)
2323

2424
// Profile-based configurations
2525
// When -Pname is passed, the property exists (even if empty)
@@ -32,23 +32,25 @@ def metricsProfile = project.hasProperty('metrics')
3232

3333
java {
3434
toolchain {
35-
languageVersion = JavaLanguageVersion.of(24)
35+
languageVersion = JavaLanguageVersion.of(25)
3636
}
3737
}
3838

3939
dependencies {
4040
// Runtime dependency
4141
implementation 'org.apache.commons:commons-lang3:3.18.0'
42-
42+
4343
// Base provided dependency
4444
if (nativeProfile) {
4545
implementation "org.restheart:restheart-commons:${restheartVersion}"
4646
implementation "org.restheart:restheart:${restheartVersion}"
4747
implementation "org.restheart:restheart-polyglot:${restheartVersion}"
48+
// Update transitive dependency of undertow-core required for the native image build
49+
implementation 'org.wildfly.common:wildfly-common:1.7.0.Final'
4850
} else {
4951
compileOnly "org.restheart:restheart-commons:${restheartVersion}"
5052
}
51-
53+
5254
// Profile-based dependencies
5355
if (securityProfile) {
5456
implementation "org.restheart:restheart-security:${restheartVersion}"
@@ -77,7 +79,7 @@ tasks.named('jar') {
7779
archiveBaseName = 'restheart-plugin-skeleton'
7880
archiveVersion = ''
7981
destinationDirectory = file("$rootDir/target")
80-
82+
8183
// Always set Main-Class for native builds
8284
manifest {
8385
attributes(
@@ -123,7 +125,7 @@ tasks.withType(Javadoc).configureEach {
123125
if (nativeProfile) {
124126
def nativeGc = findProperty('native.gc') ?: '--gc=serial'
125127
def nativeQuickBuild = findProperty('native.quickBuild') == null ? true : findProperty('native.quickBuild').toBoolean()
126-
128+
127129
graalvmNative {
128130
binaries {
129131
main {
@@ -136,24 +138,24 @@ if (nativeProfile) {
136138
}
137139
}
138140
}
139-
141+
140142
tasks.named('nativeCompile') {
141143
doLast {
142144
def outputDir = file("$rootDir/target")
143145
outputDir.mkdirs()
144-
146+
145147
// Copy the native image to target directory
146148
def buildDir = file("$rootDir/build/native/nativeCompile")
147149
def nativeExe = file("$buildDir/restheart-plugin-skeleton")
148-
150+
149151
// Also check for dylib on macOS or exe on Windows
150152
if (!nativeExe.exists()) {
151153
nativeExe = file("$buildDir/restheart-plugin-skeleton.dylib")
152154
}
153155
if (!nativeExe.exists()) {
154156
nativeExe = file("$buildDir/restheart-plugin-skeleton.exe")
155157
}
156-
158+
157159
if (nativeExe.exists()) {
158160
def targetName = nativeExe.name.replace('.dylib', '').replace('.exe', '')
159161
def targetExe = file("$rootDir/target/$targetName")
@@ -168,7 +170,7 @@ if (nativeProfile) {
168170
} else {
169171
println "Warning: Native image not found in $buildDir"
170172
}
171-
173+
172174
// Create plugins directory
173175
file("$rootDir/target/plugins").mkdirs()
174176
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ org.gradle.configuration-cache=false
99
# org.gradle.java.home=/path/to/java24
1010

1111
# RESTHeart properties
12-
restheart.version=[8.12.0,8.1000.0)
12+
restheart.version=[9.0.0,9.1000.0)
1313

1414
# Native image properties (used with -Pnative)
1515
native.gc=--gc=serial

pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
16-
<maven.compiler.release>24</maven.compiler.release>
17-
<restheart.version>[8.13.0,8.1000.0)</restheart.version>
16+
<maven.compiler.release>25</maven.compiler.release>
17+
<restheart.version>[9.0.0,9.1000.0)</restheart.version>
1818
<native.gc>--gc=serial</native.gc><!-- garbage collector 'G1' is only availabe on Linux and it is better than 'serial' -->
1919
<native.quickBuild>true</native.quickBuild>
2020
</properties>
@@ -118,6 +118,12 @@
118118
<artifactId>restheart-polyglot</artifactId>
119119
<version>${restheart.version}</version>
120120
</dependency>
121+
<!-- Update transitive dependency of undertow-core required for the native image build -->
122+
<dependency>
123+
<groupId>org.wildfly.common</groupId>
124+
<artifactId>wildfly-common</artifactId>
125+
<version>1.7.0.Final</version>
126+
</dependency>
121127
</dependencies>
122128
<build>
123129
<plugins>

0 commit comments

Comments
 (0)