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

Document that plugin adds annotation processors automatically,… #873

Merged
merged 4 commits into from
Nov 23, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,17 @@ The https://plugins.gradle.org/plugin/io.micronaut.library[Micronaut library plu
* Applies the https://search.maven.org/artifact/io.micronaut.platform/micronaut-platform[Micronaut Bill of Materials (BOM)]
* Applies the `java-library` plugin
* Configures annotation processing for the current language (Groovy, Java or Kotlin)
* Adds annotation processors automatically for Micronaut modules
wetted marked this conversation as resolved.
Show resolved Hide resolved
** `io.micronaut.data:micronaut-data-processor`
** `io.micronaut.jaxrs:micronaut-jaxrs-processor`
** `io.micronaut.micrometer:micronaut-micrometer-annotation`
** `io.micronaut.microstream:micronaut-microstream-annotations`
** `io.micronaut.openapi:micronaut-openapi`
** `io.micronaut.security:micronaut-security-annotations`
** `io.micronaut.serde:micronaut-serde-processor`
** `io.micronaut.spring:micronaut-spring-annotation`
** `io.micronaut.tracing:micronaut-tracing-annotation`
** `io.micronaut.validation:micronaut-validation-processor`

The `micronaut` DSL can be used to configure how this behaves.

Expand Down Expand Up @@ -376,6 +387,29 @@ micronaut {
}
----

In some circumstances, automatic dependencies – e.g. annotation processors listed above – can get in the way. This should be rare, but it is possible to suppress them, as follows. It has no default and using suppression shifts responsibility of adding the dependencies to the user.

.Suppressing automatic dependencies
[source, groovy, subs="verbatim,attributes", role="multi-language-sample"]
----
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")
}
----

[source, kotlin, subs="verbatim,attributes", role="multi-language-sample"]
----
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")
}
----

NOTE: The Micronaut Library plugin also supports Groovy and Kotlin sources.

=== Kotlin Support
Expand Down
Loading