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

Carsten Ziegeler commented on FELIX-5373:
-----------------------------------------

[~olli] I think this works as expected and as has been requested a while back. 
If you specify label/description, it is assume that you want to generate 
metatype. Therefore if you set metatype to false with label/description in 
place, the warnings are printed.
Now, if you set metatype to true but do not have any property to be configured 
(no properties or all properties private), then there is no point in generating 
the metatype, it would be empty.

Maybe I'm missing something, but I think this is fine the way it is.

> build fails when enabling metatype and using private properties only
> --------------------------------------------------------------------
>
>                 Key: FELIX-5373
>                 URL: https://issues.apache.org/jira/browse/FELIX-5373
>             Project: Felix
>          Issue Type: Bug
>          Components: SCR Tooling
>    Affects Versions: maven-scr-plugin 1.22.0
>            Reporter: Oliver Lietz
>         Attachments: FELIX-5373.tar.gz
>
>
> {noformat}
> @Component(
>     label = "Foo",
>     description = "SCR Foo Service",
>     metatype = true
> )
> @Service
> @Properties({
>     @Property(
>         name = Constants.SERVICE_VENDOR,
>         value = "Example"
>     ),
>     @Property(
>         name = Constants.SERVICE_DESCRIPTION,
>         value = "service doing foo"
>     )/*,
>     @Property(
>         name = "foo",
>         value = "bar"
>     )*/
> })
> public class ScrFooService implements FooService {
>     public void foo() {
>     }
> }
> {noformat}
> {{metatype = false}} (or not set):
> {noformat}
> [WARNING] /[...]/ScrFooService.java [1:1]:  Component 
> org.apache.felix.FELIX_5373.internal.ScrFooService has set a label. However 
> metatype is set to false. This label is ignored.
> [WARNING] /[...]/ScrFooService.java [1:1]:  Component 
> org.apache.felix.FELIX_5373.internal.ScrFooService has set a description. 
> However metatype is set to false. This description is ignored.
> {noformat}
> {{metatype = true}}:
> {noformat}
> [ERROR] /[...]/ScrFooService.java [1:1]: @Component : Component is defined to 
> generate metatype information, however no properties have been defined; in 
> case no properties are wanted, consider to use 'metatype=false'
> {noformat}
> The build succeeds only without warnings when adding a non-private property 
> (where it should also succeed with private properties only).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to