Skip to content

Commit 45e1633

Browse files
joschawing328
andauthored
docs: how to use local JARs and SNAPSHOTbuilds. (#794)
Co-authored-by: William Cheng <wing328hk@gmail.com>
1 parent 67f6457 commit 45e1633

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

apps/generator-cli/src/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,44 @@ If you're using a private maven registry you can configure the `downloadUrl` and
196196

197197
If the `version` property param is set it is not necessary to configure the `queryUrl`.
198198

199+
### Use locally built JAR
200+
In order to use a locally built jar of the generator CLI, you can copy the jar from your local build (i.e. if you were to `build` the [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator) repository it would be in `~/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar`) into `./node_modules/@openapitools/openapi-generator-cli/versions/` and change the `version` in the `openapitools.json` file to the base name of the jar file.
201+
E.g.:
202+
```sh
203+
cd openapi-generator
204+
./mvnw clean package
205+
cp ./modules/openapi-generator-cli/target/openapi-generator-cli.jar /your/project/node_modules/@openapitools/openapi-generator-cli/versions/my-local-snapshot.jar
206+
```
207+
and then:
208+
```json
209+
{
210+
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
211+
"spaces": 2,
212+
"generator-cli": {
213+
"version": "my-local-snapshot",
214+
}
215+
}
216+
```
217+
218+
### Use nightly `SNAPSHOT` build
219+
Change your `openapitools.json` to:
220+
221+
```json
222+
{
223+
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
224+
"spaces": 2,
225+
"generator-cli": {
226+
"version": "7.9.0-20240829.123431-22",
227+
"repository": {
228+
"downloadUrl": "https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.9.0-SNAPSHOT/openapi-generator-cli-${versionName}.jar"
229+
}
230+
}
231+
}
232+
```
233+
234+
Example is with a snapshot of `7.9.0`, please change the `version` and `downloadUrl` accordingly.
235+
You can find all snapshots [here](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/).
236+
199237
## Run specific generators
200238

201239
| cmd | v3.0 runs | v2.0 runs |

0 commit comments

Comments
 (0)