...
No Format |
---|
... <Include-Resource> src/main/resources, target/scr-plugin-generated </Include-Resource> <Service-Component> OSGI-INF/serviceComponents.xml </Service-Component> ... |
Annotations
The maven-scr-plugin
uses the SCR
annotations from the corresponding subproject at Apache Felix. All annotations are in the org.apache.felix.scr.annotations
package. If you want to use the annotations in your project, make sure that you add a dependency to the annotations to your POM
:
No Format |
---|
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.0.0</version>
</dependency>
|
The following annotations are supported:
Anchor | ||||
---|---|---|---|---|
|
Component
The Component
annotation is the only required annotation. If this annotation is not declared for a Java class, the class is not declared as a component.
This annotation is used to declare the <component>
element of the component declaration. See section 112.4.3, Component Element, in the OSGi Service Platform Service Compendium Specification for more information. The required <implementation>
element is automatically generated with the fully qualified name of the class containing the Component
annotation.
Supported attributes:
Name | Default Value | Required | SCR | Metatype | Description |
name | Fully qualified name of the Java class | no | | | Defines the Component name also used as the PID for the Configuration Admin Service |
ds | | no | Whether Declarative Services descriptor is generated or not. If this parameter is not set or set to | ||
abstract | see description | no | This marks an abstract service description which is not added to the descriptor but intended for reuse through inheritance. This attribute defaults to | ||
enabled | | no | | Whether the component is enabled when the bundle starts | |
factory | no | | Whether the component is a factory component | ||
immediate | no | | Whether the component is immediately activated | ||
inherit | | no | Whether any service, property and reference declarations from base classes should be inherited by this class. | ||
metatype | | no | Whether Metatype Service data is generated or not. If this parameter is not set or set to | ||
label | | no | | This is generally used as a title for the object described by the meta type. This name may be localized by prepending a | |
description | | no | | This is generally used as a description for the object described by the meta type. This name may be localized by prepending a |
JavaDoc tags
The scr
goal of the maven-scr-plugin
looks for the following JavaDoc tags when building component descriptors:
...