Can you file an issue with the archetypes, they are wrong.
On 23 Nov 2010, at 14:41, Pete Muir wrote:
> I think it should have the @Target's that the spec describes, anything else is
non-portable. Erroring, or maybe warning (I would prefer an error), is a good idea.
>
> On 23 Nov 2010, at 14:27, Alexey Kazakov wrote:
>
>> Hi Pete,
>>
>> Could you take a look at
https://jira.jboss.org/browse/JBIDE-7710
>> JSR-299 says that a qualifier type is a Java annotation defined as
@Target({METHOD, FIELD, PARAMETER, TYPE}) or @Target({FIELD, PARAMETER}) (an event
qualifier type):
>>
>> 2.3.2. Defining new qualifier types
>> A qualifier type is a Java annotation defined as @Target({METHOD, FIELD,
PARAMETER, TYPE}) and @Retention(RUNTIME).
>> ...
>>
>> 10.1. Event types and qualifier types
>> ...
>> An event qualifier type is just an ordinary qualifier type as specified in
Section 2.3.2, “Defining new qualifier types” with the exception that it may be declared
@Target({FIELD, PARAMETER}).
>> ...
>>
>> But the spec doesn't require to treat other kinds of @Target (for example
@Target({FIELD, METHOD, PARAMETER} which is used in weld-jsf-jee archetype) as a
definition error.
>> It seems that we got it wrong and if there is any @Target except @Target({METHOD,
FIELD, PARAMETER, TYPE}) or @Target({FIELD, PARAMETER}) then JBT marks such definitions as
errors:
>> Qualifier annotation type must be annotated with @Target({TYPE, METHOD, FIELD,
PARAMETER}) or @Target({METHOD, FIELD}) [JSR-299 §2.3.2, §10.1]
>> Can you confirm that actually a qualifier type could have any @Target?
>>
>> Thanks.