Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I reference 4.3.1.SNAPSHOT version of gradle plugin? #6151

Closed
AceHack opened this issue May 3, 2020 · 2 comments
Closed

How can I reference 4.3.1.SNAPSHOT version of gradle plugin? #6151

AceHack opened this issue May 3, 2020 · 2 comments

Comments

@AceHack
Copy link

AceHack commented May 3, 2020

I can't figure out how to do it. Any kind of nightly build would be great. thanks.

@AceHack
Copy link
Author

AceHack commented May 3, 2020

Here is how I made snapshots work with the gradle plugin. I also built with --refresh-dependencies to ensure I was using the latest snapshot.

In build.gradle.kts

plugins {
    java
    id("org.openapi.generator") version "4.3.1-SNAPSHOT"
}

repositories {
    mavenCentral()
    maven("https://oss.sonatype.org/content/repositories/snapshots")
}

tasks.compileJava {
    dependsOn(tasks.openApiGenerate)
}

sourceSets.main {
    java.srcDir(openApiGeneratedDir)
}

openApiGenerate {
    inputSpec.set("https://xxx.yyy.zzz")
    validateSpec.set(true)
    generatorName.set("java")
    engine.set("mustache")
    skipOverwrite.set(false)
    outputDir.set(openApiGeneratedDir)
    apiPackage.set("datalake.subscription.api")
    invokerPackage.set("datalake.subscription.invoker")
    modelPackage.set("datalake.subscription.model")
    generateApiTests.set(false)
    generateApiDocumentation.set(false)
    generateModelTests.set(false)
    generateModelDocumentation.set(false)
    configOptions.set(mapOf(
            "java8" to "true",
            "dateLibrary" to "java8",
            "library" to "asyncNative",
            "serializationLibrary" to "jackson"
    ))
}

in setting.gradle.kts

pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
        maven("https://oss.sonatype.org/content/repositories/snapshots")
    }

    resolutionStrategy.eachPlugin {
        if(requested.id.id == "org.openapi.generator") {
            useModule("org.openapitools:openapi-generator-gradle-plugin:${requested.version}")
        }
    }
}

@AceHack AceHack closed this as completed May 3, 2020
@davide1995
Copy link

Well, what was the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants