Closed marendil closed 5 years ago
Hi, is there any possibility that you will merge this pull request into master in near future?
@marendil Thank you for your contribution and sorry for the delay. I will try to look at this patch this weekend.
Thank You very much for merge. When do you plan to make new release? I'm not hiding that we are using ClassIndex in our project and don't want to use any snapshot version
I've merged your pull request. I've also fixed small issue where annotations not marked with Repeatable would also be indexed (see: https://github.com/atteo/classindex/commit/cec5878b4f6de9f68e5e4017cffbffed010d7d0c). I will push the release to Maven Central shortly.
Spoko :-)
Please take into account that it takes a few days for a release to propagate to Maven Central.
If you want to annotate class few times with the same annotation you could do it this way:
Java 6 and 7
Java 8 and above
In first case before my modification you have to mark
@ExampleAnnotations
with@IndexAnnotated
, and search for classes annotated with@ExampleAnnotations
instead of@ExampleAnnotation
after fix everything work as it should without any additional code.In second case
@ExampleAnnotation
had to have@Repeatable
annotation with value set as ExampleAnnotations.class.@Repeatable
annotation is compiled by another Annotation Processor which creates on-the-fly synthesized@ExampleAnnotations(@ExampleAnnotation("Example1"), @ExampleAnnotation("Example2"))
with missing metadata so it did not work. After my fix everything works fine.I've done it by adding new function in ClassIndexProcessor which checks every field in found annotation does it return list of another indexed annotations.
In pom.xml I've added testSource and testTarget to 8 and leave source and target as 1.7 because I don't know if you want to upgrade whole project to java 8. It makes little problem in IntelliJ because it doesn't support different java versions in one module but maven build work as it should.