Skip to content

Commit 03d1a51

Browse files
committed
fix: restore Micronaut annotation processor auto-config in GrailsGradlePlugin
The annotation processor (micronaut-inject-java) is required for Java sources that use Micronaut annotations like @ConfigurationProperties and @singleton. Removing it broke the issue-11767 plugin's PluginJavaMicronautBean, which depends on compile-time code generation. Assisted-by: Claude Code <Claude@Claude.ai>
1 parent 782b950 commit 03d1a51

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,10 @@ class GrailsGradlePlugin extends GroovyPlugin {
379379
}
380380
}
381381

382-
// Micronaut annotation processors are not auto-configured here because they
383-
// are incompatible with Groovy incremental compilation. See the Grails
384-
// documentation for manual setup when Java sources use Micronaut annotations.
382+
project.logger.info('Adding Micronaut annotationProcessor dependencies to project {}', project.name)
383+
project.getDependencies().add('annotationProcessor', project.dependencies.platform("io.micronaut.platform:micronaut-platform:$micronautPlatformVersion"))
384+
project.getDependencies().add('annotationProcessor', 'io.micronaut:micronaut-inject-java')
385+
project.getDependencies().add('annotationProcessor', 'jakarta.annotation:jakarta.annotation-api')
385386

386387
project.logger.info('Configuring CLASSIC boot loader for Micronaut compatibility in {}', project.name)
387388
project.tasks.withType(BootJar).configureEach { BootJar bootJar ->

0 commit comments

Comments
 (0)