AutoValue not working in Eclipse Oxygen

1.5k views Asked by At

I am using Eclipse IDE for Java Developers Version: Oxygen.1a Release (4.7.1a) and trying to use Google's AutoValue library in my project.

I have included it as a Maven dependency:

    <!-- https://mvnrepository.com/artifact/com.google.auto.value/auto-value -->
    <dependency>
        <groupId>com.google.auto.value</groupId>
        <artifactId>auto-value</artifactId>
        <version>1.5.2</version>
        <scope>provided</scope>
    </dependency>

And trying to use it:

@AutoValue
public abstract class Person {

    @AutoValue.Builder
    public static abstract class Builder {

    }

    public static Builder builder() {
        return new AutoValue_Person.Builder();
    }   
}

The problem I am having is that AutoValue_Person cannot be resolved to a type. This should be an auto-generated class.

I also installed the m2e-apt plugin for Eclipse, and set Annottion processing mode to: "Automatically configure JDT APT", but this didn't solve the problem.

Is there a way to get it work in Eclipse?

0

There are 0 answers