Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

IntelliJ, Auto-Discover Processors from Maven #435

@eischet

Description

@eischet

Hello FreeBuilder team,

I've started using FreeBuilder and, more recently, the Google Auto Service Processor, in a Maven build.
At first, including the Auto Processor disabled FreeBuilder. I think it's because the Google plugin is explicitly added to the POM, disabling discovery of other processors.

Then, I came up with this:

<plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <annotationProcessors>
                <annotationProcessor>org.inferred.freebuilder.processor.Processor</annotationProcessor>
                <annotationProcessor>com.google.auto.service.processor.AutoServiceProcessor</annotationProcessor>
            </annotationProcessors>
            <annotationProcessorPaths>
                <path>
                    <groupId>org.inferred</groupId>
                    <artifactId>freebuilder</artifactId>
                    <version>2.6.2</version>
                </path>
                <path>
                    <groupId>com.google.auto.service</groupId>
                    <artifactId>auto-service</artifactId>
                    <version>${auto-service.version}</version>
                </path>
            </annotationProcessorPaths>
        </configuration>
</plugin>

This fixed my build. It also turns out that IntelliJ picks this up automatically and put it into the settings.
This way, I do not have to configure the settings manually in IntelliJ.
I'm using the latest version 2020.2.3.

I never configured the annotation processors manually, but there they are:

image

I can send a pull request for the readme if you think this is a valid approach, but I thought I'd better submit an issue first to discuss.

Regards,
Stefan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions