diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index 25fb2b730394..c639b67a162a 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -5,6 +5,12 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } + maven { + url "https://oss.sonatype.org/content/repositories/releases/" + } + maven { + url "https://oss.sonatype.org/content/repositories/snapshots/" + } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -35,6 +41,12 @@ targetCompatibility = 1.8 repositories { mavenCentral() mavenLocal() + maven { + url "https://oss.sonatype.org/content/repositories/releases/" + } + maven { + url "https://oss.sonatype.org/content/repositories/snapshots/" + } } dependencies { diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md index 278bddb12b52..b18720b4330a 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md @@ -2,7 +2,7 @@ This example assumes you have Gradle 4.7+ installed. No gradle wrapper is provided in samples. -First, publish the openapi-generator-gradle-plugin locally via `sh gradlew build publishToMavenLocal` in the module directory. +First, publish the openapi-generator-gradle-plugin locally via `./gradlew assemble install` in the module directory. Then, run the following tasks in this example directory. @@ -12,3 +12,9 @@ gradle openApiMeta gradle openApiValidate gradle buildGoSdk ``` + +The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example: + +```bash +gradle -PopenApiGeneratorVersion=3.0.1-SNAPSHOT openApiValidate +``` diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle index a0f00237d8a6..4a79c8e6f9a9 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle @@ -13,7 +13,8 @@ buildscript { } } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.0-SNAPSHOT" + // Updated version can be passed via command line arg as -PopenApiGeneratorVersion=VERSION + classpath "org.openapitools:openapi-generator-gradle-plugin:$openApiGeneratorVersion" } } diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties new file mode 100644 index 000000000000..cd288d87a9ad --- /dev/null +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -0,0 +1 @@ +openApiGeneratorVersion=3.0.1-SNAPSHOT