Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
maven-scr-plugin 1.22.0
-
None
Description
@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() { } }
metatype = false (or not set):
[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.
metatype = true:
[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'
The build succeeds only without warnings when adding a non-private property (where it should also succeed with private properties only).
Attachments
Attachments
Issue Links
- is related to
-
FELIX-5308 Inconsistent Validation with Metatype Container
- Closed
-
FELIX-4033 Issue warning messages for redundant SCR annotation combinations and an error for declaring the service.id property
- Closed
-
FELIX-4035 Issue warning messages when metatype is be created, but no properties are defined
- Closed