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

IntelliJ, Auto-Discover Processors from Maven #435

Closed
eischet opened this issue Oct 9, 2020 · 1 comment
Closed

IntelliJ, Auto-Discover Processors from Maven #435

eischet opened this issue Oct 9, 2020 · 1 comment

Comments

@eischet
Copy link
Contributor

eischet commented Oct 9, 2020

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

@alicederyn
Copy link
Collaborator

Hi Stefan,

If you would like to add this extra configuration as a subsection of https://github.com/inferred/FreeBuilder/#maven, with an explanation of when it might be needed, that would be very much appreciated!

Cheers,
Alice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants