I am looking for an easy way to look through a java package for my own annotation.
What I am trying to do is mark some classes with my own annotation. Every minute a scanner should scan some packages for this annotation.
With scanotation jar I tried that
URL url = ClasspathUrlFinder.findClassBase(FileWatcher.class);
and with AnnotationDB I could check if this class (FileWatcher.class) has the annotation. Now I need a list of classes in order to scan them all.
I read some articles and most people said it is not possible because of the classloader could load external jar files as well.
The other option I have is to copy all EJB Projects containing those annotations inside a subdirectory and scan all those jar files. I think that would might work, but is there no better way?
Many greetings, Hauke