Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1703

SCR Plugin not always recognizes correctly to switch into DS 1.1 descriptor mode

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • maven-scr-plugin-1.4.0
    • maven-scr-plugin-1.4.2
    • SCR Tooling
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: