@@ -34,21 +34,22 @@ Follow the [Usage Guide](https://github.com/SoftInstigate/restheart-cli/blob/mas
3434 ```
3535
36362 . ** Build (choose Maven or Gradle):**
37+
38+ Maven:
3739 ``` bash
38- # Maven
3940 ./mvnw clean package
41+ ```
4042
41- # Gradle
43+ Gradle:
44+ ``` bash
4245 ./gradlew clean build
4346 ```
4447
4548 Both produce identical outputs in the ` target/ ` directory.
4649
47503 . ** Run with Docker:**
4851 ``` bash
49- docker run --pull=always --name restheart --rm -p " 8080:8080" \
50- -v ./target:/opt/restheart/plugins/custom \
51- softinstigate/restheart -s
52+ docker run --pull=always --name restheart --rm -p " 8080:8080" -v ./target:/opt/restheart/plugins/custom softinstigate/restheart -s
5253 ```
5354
5455 > ** Note:** The ` -s ` flag runs in ** standalone mode** (no MongoDB). Remove it to enable MongoDB-dependent plugins.
@@ -83,23 +84,26 @@ To run RESTHeart with MongoDB:
83841 . ** Start MongoDB:**
8485 ``` bash
8586 docker run -d --name mongodb -p 27017:27017 mongo --replSet=rs0
87+ ```
88+ ``` bash
8689 docker exec mongodb mongosh --quiet --eval " rs.initiate()"
8790 ```
8891
89- 2 . ** Build with MongoDB profile:**
92+ 2 . ** Build your plugin:**
93+
94+ Maven:
9095 ``` bash
91- # Maven
92- ./mvnw clean package -Pmongodb
96+ ./mvnw clean package
97+ ```
9398
94- # Gradle
95- ./gradlew clean build -Pmongodb
99+ Gradle:
100+ ``` bash
101+ ./gradlew clean build
96102 ```
97103
98- 3 . ** Run RESTHeart (without -s flag):**
104+ 3 . ** Run RESTHeart (without -s flag to enable MongoDB plugins ):**
99105 ``` bash
100- docker run --name restheart --rm -p " 8080:8080" \
101- -v ./target:/opt/restheart/plugins/custom \
102- softinstigate/restheart
106+ docker run --name restheart --rm -p " 8080:8080" -v ./target:/opt/restheart/plugins/custom softinstigate/restheart
103107 ```
104108
1051094 . ** Test:**
@@ -109,47 +113,49 @@ To run RESTHeart with MongoDB:
109113
110114⚠️ ** Warning:** This setup is insecure - for development/testing only.
111115
116+ > ** Note:** Your plugin only depends on ` restheart-commons ` (provided scope). RESTHeart running in Docker already includes all its plugins (MongoDB, Security, GraphQL, etc.).
117+
112118---
113119
114- ## Available Profiles
120+ ## Profiles for Native Image Builds
115121
116- Profiles add RESTHeart modules to your build:
122+ > ** Important: ** These profiles are ** only ** used when building native executables ( ` -Pnative ` ). They bundle RESTHeart plugins into the native executable. For regular JAR builds, your plugin only depends on ` restheart-commons ` .
117123
118124| Profile | Description | Maven Syntax | Gradle Syntax |
119125| ------------------------ | -------------------------------------------- | -------------------- | -------------------- |
120126| ` native ` | Build native executable with GraalVM | ` -Pnative ` | ` -Pnative ` |
121- | ` security ` | Add authentication and authorization | ` -Psecurity ` | ` -Psecurity ` |
122- | ` mongodb ` | Add MongoDB REST API support | ` -Pmongodb ` | ` -Pmongodb ` |
123- | ` graphql ` | Add GraphQL API support | ` -Pgraphql ` | ` -Pgraphql ` |
124- | ` mongoclient-provider ` | Add MongoDB client provider | ` -Pmongoclient-provider ` | ` -Pmongoclient-provider ` |
125- | ` metrics ` | Add monitoring and metrics | ` -Pmetrics ` | ` -Pmetrics ` |
126- | ` all-restheart-plugins ` | Include all above modules (except native) | ` -Pall-restheart-plugins ` | ` -Pall-restheart-plugins ` |
127+ | ` security ` | Bundle RESTHeart Security into native image | ` -Psecurity ` | ` -Psecurity ` |
128+ | ` mongodb ` | Bundle RESTHeart MongoDB into native image | ` -Pmongodb ` | ` -Pmongodb ` |
129+ | ` graphql ` | Bundle RESTHeart GraphQL into native image | ` -Pgraphql ` | ` -Pgraphql ` |
130+ | ` mongoclient-provider ` | Bundle MongoDB client provider | ` -Pmongoclient-provider ` | ` -Pmongoclient-provider ` |
131+ | ` metrics ` | Bundle RESTHeart Metrics into native image | ` -Pmetrics ` | ` -Pmetrics ` |
132+ | ` all-restheart-plugins ` | Bundle all RESTHeart plugins | ` -Pall-restheart-plugins ` | ` -Pall-restheart-plugins ` |
127133
128134### Examples
129135
136+ ** Native executable with Security and MongoDB plugins bundled:**
137+
138+ Maven:
130139``` bash
131- # Maven: Native build with security and MongoDB
132140./mvnw clean package -Pnative,security,mongodb
141+ ```
133142
134- # Gradle: Native build with security and MongoDB
143+ Gradle:
144+ ``` bash
135145./gradlew clean build -Pnative -Psecurity -Pmongodb
146+ ```
136147
137- # Maven: All modules
138- ./mvnw clean package -Pall-restheart-plugins
148+ ** Native executable with all RESTHeart plugins bundled:**
139149
140- # Gradle: All modules
141- ./gradlew clean build -Pall-restheart-plugins
150+ Maven:
151+ ``` bash
152+ ./mvnw clean package -Pnative,all-restheart-plugins
142153```
143154
144- ### Common Scenarios
145-
146- | Scenario | Maven Command | Gradle Command |
147- | ----------------------------- | -------------------------------------------- | -------------------------------------------- |
148- | Standalone demo | ` ./mvnw clean package ` | ` ./gradlew clean build ` |
149- | MongoDB development | ` ./mvnw clean package -Pmongodb ` | ` ./gradlew clean build -Pmongodb ` |
150- | Secured MongoDB API | ` ./mvnw clean package -Psecurity,mongodb ` | ` ./gradlew clean build -Psecurity -Pmongodb ` |
151- | GraphQL over MongoDB | ` ./mvnw clean package -Pgraphql,mongodb ` | ` ./gradlew clean build -Pgraphql -Pmongodb ` |
152- | All modules | ` ./mvnw clean package -Pall-restheart-plugins ` | ` ./gradlew clean build -Pall-restheart-plugins ` |
155+ Gradle:
156+ ``` bash
157+ ./gradlew clean build -Pnative -Pall-restheart-plugins
158+ ```
153159
154160---
155161
@@ -168,29 +174,38 @@ sdk use java 24.0.2-graalce
168174### Build Commands
169175
170176** Quick build** (faster, default):
177+
178+ Maven:
171179``` bash
172- # Maven
173180./mvnw clean package -Pnative
181+ ```
174182
175- # Gradle
183+ Gradle:
184+ ``` bash
176185./gradlew clean build -Pnative
177186```
178187
179188** Full optimization** (slower build, faster runtime):
189+
190+ Maven:
180191``` bash
181- # Maven
182192./mvnw clean package -Pnative -Dnative.quickBuild=false
193+ ```
183194
184- # Gradle
195+ Gradle:
196+ ``` bash
185197./gradlew clean build -Pnative -Pnative.quickBuild=false
186198```
187199
188200** Custom garbage collector** (G1 on Linux, serial elsewhere):
201+
202+ Maven:
189203``` bash
190- # Maven
191204./mvnw clean package -Pnative -Dnative.gc=--gc=G1
205+ ```
192206
193- # Gradle
207+ Gradle:
208+ ``` bash
194209./gradlew clean build -Pnative -Pnative.gc=--gc=G1
195210```
196211
@@ -221,11 +236,7 @@ target/
221236Override settings without rebuilding using the ` RHO ` environment variable:
222237
223238``` bash
224- docker run --name restheart --rm \
225- -e RHO=" /http-listener/host->'0.0.0.0';/helloWorldService/message->'Ciao Mondo!'" \
226- -p " 8080:8080" \
227- -v ./target:/opt/restheart/plugins/custom \
228- softinstigate/restheart -s
239+ docker run --name restheart --rm -e RHO=" /http-listener/host->'0.0.0.0';/helloWorldService/message->'Ciao Mondo!'" -p " 8080:8080" -v ./target:/opt/restheart/plugins/custom softinstigate/restheart -s
229240```
230241
231242Test:
@@ -306,11 +317,14 @@ mvn dependency:tree -Dscope=compile
306317 ```
307318
3083192 . ** Build with verbose output:**
320+
321+ Maven:
309322 ``` bash
310- # Maven
311323 ./mvnw package -Pnative -X
324+ ```
312325
313- # Gradle
326+ Gradle:
327+ ``` bash
314328 ./gradlew build -Pnative --info
315329 ```
316330
0 commit comments