I wannna use annotation processor in my IDEA plugin, which will resolve classes and methods with 'TaskID' annotation. But I found that my processor can't run at all. I do wanna know what's wrong and what should I do. Here is my code below
import com.google.auto.service.AutoService;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.Processor;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.*;
import javax.lang.model.util.Elements;
import java.util.*;
@AutoService(Processor.class)
public class AnnotationProcessor extends AbstractProcessor {
@Retention(RetentionPolicy.SOURCE)
@Target({TYPE, METHOD})
public @interface TaskID {
/**
* Task ID
*/
String[] taskID();
}
dependencies {
annotationProcessor 'com.google.auto.service:auto-service:1.0-rc2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'com.google.auto.service:auto-service:1.0-rc2'
implementation ("com.github.javaparser:javaparser-core:3.25.4")
}
Enviroment: JDK 11, Gradle-7.6 IntelliJ IDEA 2021.3.1 (Community Edition)