diff --git a/hello-world-groovy/build.gradle b/hello-world-groovy/build.gradle index 4d9ee84..6f726f5 100644 --- a/hello-world-groovy/build.gradle +++ b/hello-world-groovy/build.gradle @@ -1,6 +1,6 @@ plugins { id "groovy" - id "com.github.johnrengelman.shadow" version "5.0.0" + id "com.github.johnrengelman.shadow" version "5.2.0" id "application" } @@ -18,6 +18,7 @@ configurations { } dependencies { + annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion") compileOnly platform("io.micronaut:micronaut-bom:$micronautVersion") compileOnly "io.micronaut:micronaut-inject-groovy" compileOnly "io.micronaut.configuration:micronaut-openapi" @@ -25,17 +26,18 @@ dependencies { implementation "io.swagger.core.v3:swagger-annotations" implementation "io.micronaut:micronaut-runtime-groovy" implementation "io.micronaut:micronaut-validation" + implementation "javax.annotation:javax.annotation-api" implementation "io.micronaut:micronaut-http-server-netty" implementation "io.micronaut:micronaut-http-client" runtimeOnly "ch.qos.logback:logback-classic:1.2.3" testCompileOnly platform("io.micronaut:micronaut-bom:$micronautVersion") + testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion") testImplementation("org.spockframework:spock-core") { exclude group: "org.codehaus.groovy", module: "groovy-all" } testImplementation "io.micronaut:micronaut-inject-groovy" testImplementation "io.micronaut.test:micronaut-test-spock" testImplementation "io.micronaut.test:micronaut-test-junit5" - testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.0" } test.classpath += configurations.developmentOnly @@ -49,5 +51,7 @@ shadowJar { mergeServiceFiles() } -run.classpath += configurations.developmentOnly -run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote') +tasks.withType(JavaExec) { + classpath += configurations.developmentOnly + jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote') +} diff --git a/hello-world-groovy/gradle.properties b/hello-world-groovy/gradle.properties index 2e538cd..e95c26f 100644 --- a/hello-world-groovy/gradle.properties +++ b/hello-world-groovy/gradle.properties @@ -1 +1 @@ -micronautVersion=1.2.0 \ No newline at end of file +micronautVersion=1.3.5 \ No newline at end of file diff --git a/hello-world-groovy/gradle/wrapper/gradle-wrapper.properties b/hello-world-groovy/gradle/wrapper/gradle-wrapper.properties index b0acbdc..ba94df8 100644 --- a/hello-world-groovy/gradle/wrapper/gradle-wrapper.properties +++ b/hello-world-groovy/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/hello-world-groovy/src/main/groovy/example/Application.groovy b/hello-world-groovy/src/main/groovy/example/Application.groovy index a93c26b..13b3152 100644 --- a/hello-world-groovy/src/main/groovy/example/Application.groovy +++ b/hello-world-groovy/src/main/groovy/example/Application.groovy @@ -15,11 +15,51 @@ */ package example +import groovy.transform.CompileStatic import io.micronaut.runtime.Micronaut +import io.swagger.v3.oas.annotations.ExternalDocumentation +import io.swagger.v3.oas.annotations.OpenAPIDefinition +import io.swagger.v3.oas.annotations.info.Contact +import io.swagger.v3.oas.annotations.info.Info +import io.swagger.v3.oas.annotations.info.License +import io.swagger.v3.oas.annotations.security.SecurityRequirement +import io.swagger.v3.oas.annotations.servers.Server +import io.swagger.v3.oas.annotations.servers.ServerVariable +import io.swagger.v3.oas.annotations.tags.Tag +@OpenAPIDefinition( + info = @Info( + title = "the title", + version = "0.0", + description = "My API", + license = @License(name = "Apache 2.0", url = "http://foo.bar"), + contact = @Contact(url = "http://gigantic-server.com", name = "Fred", email = "Fred@gigantic-server.com") + ), + tags = [ + @Tag(name = "Tag 1", description = "desc 1", externalDocs = @ExternalDocumentation(description = "docs desc")), + @Tag(name = "Tag 2", description = "desc 2", externalDocs = @ExternalDocumentation(description = "docs desc 2")), + @Tag(name = "Tag 3") + ], + externalDocs = @ExternalDocumentation(description = "definition docs desc"), + security = [ + @SecurityRequirement(name = "req 1", scopes = ["a", "b"]), + @SecurityRequirement(name = "req 2", scopes = ["b", "c"]) + ], + servers = [ + @Server( + description = "server 1", + url = "http://foo", + variables = [ + @ServerVariable(name = "var1", description = "var 1", defaultValue = "1", allowableValues = ["1", "2"]), + @ServerVariable(name = "var2", description = "var 2", defaultValue = "1", allowableValues = ["1", "2"]) + ]) + ] +) + +@CompileStatic class Application { static void main(String[] args) { - Micronaut.run(getClass()) + Micronaut.run(Application) } } diff --git a/hello-world-groovy/src/main/resources/logback.xml b/hello-world-groovy/src/main/resources/logback.xml index d928025..ec4baa0 100644 --- a/hello-world-groovy/src/main/resources/logback.xml +++ b/hello-world-groovy/src/main/resources/logback.xml @@ -1,7 +1,7 @@ - true + false