SCR Plugin not always recognizes correctly to switch into DS 1.1 descriptor mode
--------------------------------------------------------------------------------
Key: FELIX-1703
URL: https://issues.apache.org/jira/browse/FELIX-1703
Project: Felix
Issue Type: Improvement
Components: Maven SCR Plugin
Affects Versions: maven-scr-plugin-1.4.0
Reporter: Felix Meschberger
Fix For: maven-scr-plugin-1.4.1
Given a simple component like this:
/**
* @scr.component activate="newActivate" deactivate="newDeactivate"
* @scr.property name="sample" value="Sample Value"
*/
public class SampleComponent {
private final Logger log = LoggerFactory.getLogger(getClass());
protected void activate(Map<?, ?> config) {
log.info("Component {} starting", config.get("component.name"));
}
protected void deactivate(Map<?, ?> config, int reason) {
log.info("Component {} stopping, reason: {}",
config.get("component.name"), reason);
}
}
The Maven SCR plugin in this case does not accept the signatures of the
activate and deactivate methods to require a DS 1.1 descriptor.
Maybe, for backwards compatibility with existing source, it is also better to
not switch into a DS 1.1 descriptor: There might be code where methods with
signatures newly supported by DS 1.1 should not be used. In this case it would
be good to be able to explicitly declare the component to be a DS 1.1 compliant
component.
Currently it is not possible to specify this on a per-component level. It is
only possible per plugin configuration or by having the plugin detect a DS 1.1
feature, such as the activate or deactivate attribute to the @scr.component tag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.