micronaut-projects / micronaut-gradle-plugin

A Gradle Plugin for Micronaut
Apache License 2.0
66 stars 44 forks source link

Gradle plugin prevents incremental compilation for Groovy #906

Open jimmypoms opened 11 months ago

jimmypoms commented 11 months ago

Expected Behavior

Applying the micronaut gradle plugins should allow groovy incremental compilation.

Actual Behaviour

When applying any of the micronaut gradle plugins, a bunch of annotation processors are added to the groovy source sets. This disables incremental compilation for groovy.

Steps To Reproduce

  1. Create demo app for groovy https://micronaut.io/launch/
  2. Enable incremental compilation by adding the following snippet to the root build.gradle
    tasks.withType(GroovyCompile) {
    options.incremental = true
    }
  3. Compile groovy with ./gradlew compileGroovy
  4. The build errors with
    Enabling incremental compilation and configuring Java annotation processors for Groovy compilation is not allowed. Disable incremental Groovy compilation or remove the Java annotation processor configuration.

Environment Information

No response

Example Application

No response

Version

4.2.1

sdelamo commented 9 months ago

@jimmypoms

You can suppress automatic dependencies:

micronaut {
    // The Micronaut plugins can automatically add dependencies to your project. If, for some reason,
    // a dependency shouldn't be automatically added, you can add its coordinates to this set.
    // The format is "group:name". It must not include the version.
    ignoredAutomaticDependencies.add("io.micronaut.data:micronaut-data-processor")
    ignoredAutomaticDependencies.add("io.micronaut.jaxrs:micronaut-jaxrs-processor")
    ignoredAutomaticDependencies.add("io.micronaut.micrometer:micronaut-micrometer-annotation")
    ignoredAutomaticDependencies.add("io.micronaut.microstream:micronaut-microstream-annotations")
    ignoredAutomaticDependencies.add("io.micronaut.openapi:micronaut-openapi")
    ignoredAutomaticDependencies.add("io.micronaut.security:micronaut-security-annotations")
    ignoredAutomaticDependencies.add("io.micronaut.serde:micronaut-serde-processor")
    ignoredAutomaticDependencies.add("io.micronaut.spring:micronaut-spring-annotation")
    ignoredAutomaticDependencies.add("io.micronaut.tracing:micronaut-tracing-annotation")
    ignoredAutomaticDependencies.add("io.micronaut.validation:micronaut-validation-processor")

}

Does it help?