Allow definition of annotations at package-level in package-info.java

Description

Currently, it is not possible to define package-level annotations, for example a set of analyzer definitions that are shared by all classes in a package. Having this feature would really aid in code organization, allowing global search-related annotations to be separate from model classes. The situation right now, where an AnalyzerDef annotation defined in one model class is also referencable from another model class, is not intuitive. Please see the thread below:

https://forum.hibernate.org/viewtopic.php?f=9&t=1008145&p=2438323#p2438323

Activity

Sanne GrinoveroFebruary 5, 2015 at 7:38 PM

Emmanuel BernardFebruary 4, 2015 at 6:07 PM

Just wondering, as my understanding was that the runtime (AS?) would hand you an index of the (full) deployment.

I don't think so as at least for JPA, you need per archive metadata, not per deployment to implement the spec properly.

Sanne GrinoveroFebruary 4, 2015 at 2:32 PM

You are going on a very slippery slope for a very minor feature.

I'm not going anywhere, I had already accepted your suggestion. Just wondering, as my understanding was that the runtime (AS?) would hand you an index of the (full) deployment. If that's not correct, I guess we'll never evolve it further than the known packages.

Hardy FerentschikFebruary 4, 2015 at 2:13 PM

Jandex will be most useful when we get passed an already aggregates index. As is saying, in the case where we need to bootstrap ourselves we need to build our own index. In this case I also would not scan the full classpath, but start with the approach to build the index from the classes we know contain configuration information.

Emmanuel BernardFebruary 4, 2015 at 1:56 PM

not really. Jandex is a per jar operation. You would still need to look for all jars in a classpath which is a non portable thing. You are going on a very slippery slope for a very minor feature.

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created November 11, 2010 at 10:57 PM
Updated October 31, 2017 at 12:33 PM
Resolved February 5, 2015 at 7:38 PM

Flag notifications