Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Property

Description

generateAccessors

If this switch is turned on, the bind and unbind methods for unary references are automatically generated by the plugin. By default this is set to true.

parseJavadoc

If this switch is turned on, the java source code and its javadoc tags are scanned for the scr tags (see below). The default value is true.

processAnnotations

If this switch is turned on, the java code is scanned for the scr annotations (see below). The default value is true. Note that this feature is available for versions >= 1.2.0

sourceExcludes

Comma separated list of classes to exclude when processing the source.

strictMode

The plugin distinguishes between errors and warnings. In strict mode warnings are treated as errors and cause the plugin to fail. The default value is false.

properties

A map of predefined properties. These properties are set to each component (if the component does not define the property already).

finalName

The name of the descriptor file to create. This property defaults to the value of the scr.descriptor.name property if defined. Otherwise the default is serviceComponents.xml.

metaTypeName

The name of the descriptor file to create. This property defauls to metatype.xml.

...

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, you have to use a maven-scr-plugin version >= 1.2.0 and make sure that you add a dependency to the annotations to your POM:

...

Name

Default Value

Required

SCR

Metatype

Description

name

The name of constant

yes

property.name

AD.id

The name of the property. If this tag is defined on a field with an initialization expression, the value of that expression is used as the name if the field is of type String.

value

no

property.value

AD.default

The string value of the property. This can either be a single value or an array.

longValue

no

property.value

AD.default

The long value of the property. This can either be a single value or an array.

doubleValue

no

property.value

AD.default

The double value of the property. This can either be a single value or an array.

floatValue

no

property.value

AD.default

The float value of the property. This can either be a single value or an array.

intValue

no

property.value

AD.default

The int value of the property. This can either be a single value or an array.

byteValue

no

property.value

AD.default

The byte value of the property. This can either be a single value or an array.

charValue

no

property.value

AD.default

The char value of the property. This can either be a single value or an array.

boolValue

no

property.value

AD.default

The boolean value of the property. This can either be a single value or an array.

shortValue

no

property.value

AD.default

The short value of the property. This can either be a single value or an array.

label

%<name>.name

no

AD.name

The label to display in a form to configure this property. This name may be localized by prepending a % sign to the name.

description

%<name>.description

no

AD.description

A descriptive text to provide the client in a form to configure this property. This name may be localized by prepending a % sign to the name.

propertyPrivate

Depending on the name

no

See description

Boolean flag defining whether a metatype descriptor entry should be generated for this property or not. By default a metatype descriptor entry, i.e. an AD element, is generated except for the properties service.pid, service.description, service.id, service.ranking, service.vendor, service.bundlelocation and service.factoryPid. If a property should not be available for display in a configuration user interface, this parameter should be set to true.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3682662fab037a5a-2a966466-49634452-a7069239-b32a508bddcd8ab8306d1fdf"><ac:plain-text-body><![CDATA[

cardinality

Depends on property value(s)

no

AD.cardinality

Defines the cardinality of the property and its collection type. If the cardinality is negative, the property is expected to be stored in a java.util.Vector (primitive types such as boolean are boxed in the Wrapper class), if the cardinality is positive, the property is stored in an array (primitve types are unboxed, that is Boolean type values are stored in boolean[]). The actual value defines the maximum number of elements in the vector or array, where Integer.MIN_INT describes an unbounded Vector and Integer.MAX_INT describes an unbounded array. If the cardinality is zero, the property is a scalar value. If the defined value of the property is set in the value attribute, the cardinality defaults to 0 (zero for scalar value). If the property is defined in one or more properties starting with values, the cardinality defaults to Integer.MAX_INT, that is an unbounded array.

]]></ac:plain-text-body></ac:structured-macro>

options

no

See below

See below for a description of the options attribute.

...

Name

Default Value

Required

SCR

Metatype

Description

name

The name of constant

yes

property.name

AD.id

The name of the property. If this tag is defined on a field with an initialization expression, the value of that expression is used as the name if the field is of type String.

value

no

property.value

AD.default

The value of the property. If the property type is not String, parsing of the value is done using the valueOf(String) method of the class defined by the property type

type

String

no

property.type

AD.type

The type of the property value. This must be one of String, Long, Double, Float, Integer, Byte, Char, Boolean and Short.

label

%<name>.name

no

AD.name

The label to display in a form to configure this property. This name may be localized by prepending a % sign to the name.

description

%<name>.description

no

AD.description

A descriptive text to provide the client in a form to configure this property. This name may be localized by prepending a % sign to the name.

private

Depending on the name

no

See description

Boolean flag defining whether a metatype descriptor entry should be generated for this property or not. By default a metatype descriptor entry, i.e. an AD element, is generated except for the properties service.pid, service.description, service.id, service.ranking, service.vendor, service.bundlelocation and service.factoryPid. If a property should not be available for display in a configuration user interface, this parameter should be set to true.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e1361add6fb013b9-1ba171d7-4ce04d75-94eb9ed5-23a09043167ea2e507d2d703"><ac:plain-text-body><![CDATA[

cardinality

Depends on property value(s)

no

AD.cardinality

Defines the cardinality of the property and its collection type. If the cardinality is negative, the property is expected to be stored in a java.util.Vector (primitive types such as boolean are boxed in the Wrapper class), if the cardinality is positive, the property is stored in an array (primitve types are unboxed, that is Boolean type values are stored in boolean[]). The actual value defines the maximum number of elements in the vector or array, where Integer.MIN_INT describes an unbounded Vector and Integer.MAX_INT describes an unbounded array. If the cardinality is zero, the property is a scalar value. If the defined value of the property is set in the value attribute, the cardinality defaults to 0 (zero for scalar value). If the property is defined in one or more properties starting with values, the cardinality defaults to Integer.MAX_INT, that is an unbounded array.

]]></ac:plain-text-body></ac:structured-macro>

options

no

See below

See below for a description of the options parameter.

values*

no

See below

See below for a description of parameters starting with values.

valueRef

no

AD.default

A constant containing the value for this property. The constant can either be declared in the same class as this property or in any class that is imported. The type of the property is derived from the constant.

valueRefs

no

See below

Same as the values attribute with the difference that it acts like the valueRef attribute and the value points to a constants defining the multi value for the property.

...