Skip to content

Document how to exclude an annotation processor with Maven #21109

@wilkinsona

Description

@wilkinsona

The reference documentation recommends using <optional>true</optional> when declaring a dependency on spring-boot-autoconfigure-processor but, following a discussion with @odrotbohm, it's apparent that this doesn't prevent the dependency from being packaged in the fat jar. The same goes for a Lombok dependency when generated by start.spring.io which also uses <optional>true</optional>. The Maven plugin's documentation recommends an exclusion-based approach instead.

We should review the current documentation and Maven plugin behaviour and make the updates that are necessary to make things consistent. We should also verify how things behave with Gradle. I believe it will not have the same problem if the annotationProcessor configuration is used, but we should double-check. Once this has been straightened out, we may need to make some updates to start.spring.io as it currently uses <optional>true</optional> with Lombok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions