-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Assuming you have a library my-library with the following dependencies:
dependencies {
compileOnly("org.atteo.classindex:classindex:3.4") // also tried implementation(..). Didn't work
annotationProcessor("org.atteo.classindex:classindex:3.4")
}And a custom annotation:
@Retention( RetentionPolicy.RUNTIME )
@IndexAnnotated
public @interface MyCustomAnnotation {
}And a method in the library to get all classes with that annotation:
public void getClassesWithAnnotation() {
Iterable<Class<?>> klasses = ClassIndex.getAnnotated(MyCustomAnnotation.class);
...
}And then the library is imported into another Java project as follows:
implementation("app.libs.io:my-library:2.0.0.8-SNAPSHOT") Then the Java Project has a class with that annotation:
@MyCustomAnnotation
public class TestClass {
}When the Java project calls the getClassesWithAnnotation() from the library, it gets an empty list, showing that the classes in the Java project were not scanned.
Metadata
Metadata
Assignees
Labels
No labels