From 02b1c04cc93679349499fd37e79b4557cd5e35b9 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Fri, 28 Mar 2025 19:31:53 +0100 Subject: [PATCH 1/3] Update readme file to add information how to add dependency in maven project --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 087afb36..72f0873d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,9 @@ from [kotlinx.serialization-json](https://github.com/Kotlin/kotlinx.serializatio In order to use releases add Maven Central repository to the list of repositories. -##### Kotlin +##### Gradle + +###### Kotlin ```kotlin repositories { @@ -50,7 +52,7 @@ repositories { implementation("io.github.optimumcode:json-schema-validator:0.5.1") ``` -##### Groovy +###### Groovy ```groovy repositories { @@ -68,7 +70,7 @@ implementation("io.github.optimumcode:json-schema-validator") _Release are published to Sonatype repository. The synchronization with Maven Central takes time._ _If you want to use the release right after the publication you should add Sonatype Release repository to your build script._ -##### Kotlin +###### Kotlin ```kotlin repositories { @@ -76,7 +78,7 @@ repositories { } ``` -##### Groovy +###### Groovy ```groovy repositories { @@ -84,11 +86,26 @@ repositories { } ``` +##### Maven + +You can also use `json-schema-validator` as a dependency in your maven project. +But Maven cannot use Gradle's metadata so you need to depend on a JVM-specific artifact in your project: + +```xml + + io.github.optimumcode + json-schema-validator-jvm + 0.5.1 + +``` + #### Snapshots _If you want to use SNAPSHOT version you should add Sonatype Snapshot repository to your build script._ -##### Kotlin +##### Gradle + +###### Kotlin ```kotlin repositories { @@ -103,7 +120,7 @@ implementation(platform("io.github.optimumcode:json-schema-validator-bom:0.5.2-S implementation("io.github.optimumcode:json-schema-validator") ``` -##### Groovy +###### Groovy ```groovy repositories { @@ -113,6 +130,36 @@ repositories { implementation 'io.github.optimumcode:json-schema-validator:0.5.2-SNAPSHOT' ``` +##### Maven + +For the Maven you need to add a snapshot repository to your POM file + +```xml + + + sonatype + sonatype-snapshot + https://s01.oss.sonatype.org/content/repositories/snapshots/ + + true + + + false + + + +``` + +And then you can add a dependency to a SNAPSHOT version + +```xml + + io.github.optimumcode + json-schema-validator-jvm + 0.5.2-SNAPSHOT + +``` + ### Example If you have just one JSON schema or many independent schemes From 7e1d6d82a66279858b176f10ee39e4e4d90331cd Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Fri, 28 Mar 2025 19:37:47 +0100 Subject: [PATCH 2/3] Add automatic version update for maven examples in readme --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d35fb1d..e76b7e0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,9 +129,13 @@ jobs: - name: Prepare next dev version id: prepare_next_dev run: | + # gradle sed -i -e 's/${{ needs.version.outputs.CURRENT_VERSION }}/${{ needs.version.outputs.NEXT_VERSION }}/g' gradle.properties sed -i -E -e 's/json-schema-validator((-[a-z]+)?:|\/)[0-9]+\.[0-9]+\.[0-9]+/json-schema-validator\1${{ needs.version.outputs.RELEASE_VERSION }}/g' README.md sed -i -E -e 's/json-schema-validator((-[a-z]+)?:|\/)[0-9]+\.[0-9]+\.[0-9]+(-SNAPSHOT)/json-schema-validator\1${{ needs.version.outputs.NEXT_VERSION }}/g' README.md + # maven + sed -i -e -e 's|[0-9]+\.[0-9]+\.[0-9]+|${{ needs.version.outputs.RELEASE_VERSION }}|g' README.md + sed -i -e -e 's|[0-9]+\.[0-9]+\.[0-9]+(-SNAPSHOT)|${{ needs.version.outputs.NEXT_VERSION }}|g' README.md - name: Commit next dev version id: commit_next_dev uses: EndBug/add-and-commit@v9 From 39b0ce9ee5a8611c2f06d8469bce6e49219d4dc0 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Fri, 28 Mar 2025 19:48:51 +0100 Subject: [PATCH 3/3] Add example for release repository in maven POM --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 72f0873d..45aacc95 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,24 @@ But Maven cannot use Gradle's metadata so you need to depend on a JVM-specific a ``` +And you can also add a sonatype repository to your POM file + +```xml + + + sonatype-release + sonatype-release + https://s01.oss.sonatype.org/content/repositories/releases/ + + false + + + true + + + +``` + #### Snapshots _If you want to use SNAPSHOT version you should add Sonatype Snapshot repository to your build script._