[ 
https://issues.apache.org/jira/browse/FELIX-5373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oliver Lietz updated FELIX-5373:
--------------------------------
    Description: 
{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-).



  was:
{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).




> Improve failure message when enabling metatype and using no or 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
>            Priority: Minor
>         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