Looking for annotated packages in Java?

What is the cleanest way to find all packages annotated using package level annotation in their package-info.java ?

+4
source share
2 answers

Use something like a reflections library to do the bulk of your job of checking the class path; others are available in libraries like Spring / etc.

+1
source

Yes,

http://java.sun.com/docs/books/jls/third_edition/html/packages.html

Typically, package-info.java contains only the package declaration immediately preceding the package annotations.

0
source

Source: https://habr.com/ru/post/1381805/


All Articles