Trying to use AutoValue of package com.google.auto.value.AutoValue in my java class and get error "AutoValue cannot be resolved to a type"
I have added this in pom.xml
<!-- https://mvnrepository.com/artifact/com.google.auto.value/auto-value -->
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
Java program :
package xxxx;
import ------
import com.google.auto.value.AutoValue;
@AutoValue
@DefaultCoder(SerializableCoder.class)
public abstract class ABC{
/**
* Manually create a test row.
*/
public static ABC create(List<Object> fields) {
return new AutoValue_ABC(fields); //error is here
}
public abstract List<Object> fields();
}
I tried the solutions like adding it by opening the project properties, browsing to Java Compiler -> Annotation Processing -> Factory Path, clicking on "Add External JARs" and then selecting 4 jar files - auto-service-1.0-rc1.jar , guava-16.0.1.jar , jsr-305-2.0.3.jar , auto-value-1.0-rc1.jar
Also tried adding m2e-apt plugin and Maven -> "Annotation processing" -> select "Automatically configure JDT APT..."
Still getting the errror "AutoValue cannot be resolved to a type"
Any Solutions? Thanks in Advance.