felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Windszus (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3636) Using @Service without @Component should nevertheless create a component
Date Mon, 10 Sep 2012 15:04:07 GMT

    [ https://issues.apache.org/jira/browse/FELIX-3636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452047#comment-13452047

Konrad Windszus commented on FELIX-3636:

If you provide @Service without @Component it has an influence on the scrinfo.xml but not
on the generated serviceComponents.xml. Only the latter is evaluated by the Felix SCR. That
is confusing, because usually this is not intended by the developer. Rather he implicitly
assumes, that the appropriate component is automatically generated, even if he only has @Service

I propose the following change:
If @Service is given without @Component a warning should be given out by the maven-scr-plugin.
That still assures backward compatibility for the cases, where @Service was deliberately used
without @Component(see comment 1). In my mind this is a very rare use case and maybe in the
future using one annotation without the other should rather lead to an error. The best solution
would be, to make it configurable, whether that issue should be given out as error or as warning
> Using @Service without @Component should nevertheless create a component
> ------------------------------------------------------------------------
>                 Key: FELIX-3636
>                 URL: https://issues.apache.org/jira/browse/FELIX-3636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin, SCR Annotations
>    Affects Versions: maven-scr-plugin-1.8.0, scr annotations 1.7.0
>            Reporter: Konrad Windszus
> If I use the annotation @Service without @Component no entry in the serviceComponents.xml
will be generated and no warning is given out during build from the maven-scr-plugin.
> You should either implicitly generate a component if @Service is given without @Component
or an error should be logged during build, since using @Service without @Component right now
has no effect at all and this is never intended by someone using @Service.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message