diff --git a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy index 93281534..b287b4f1 100644 --- a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy @@ -455,7 +455,9 @@ class GrailsGradlePlugin extends GroovyPlugin { agent } final String micronautVersion = project.properties['micronautVersion'] - project.dependencies.add("runtimeOnly", "io.micronaut:micronaut-inject-groovy:${micronautVersion?:defaultMicronautVersion}") + if (project.configurations.findByName("developmentOnly")) { + project.dependencies.add("developmentOnly", "io.micronaut:micronaut-inject-groovy:${micronautVersion?:defaultMicronautVersion}") + } project.afterEvaluate(new AgentTasksEnhancer()) } }