[ 
https://issues.apache.org/jira/browse/SLING-6474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15829918#comment-15829918
 ] 

Nino Martinez commented on SLING-6474:
--------------------------------------

hmm yes, I checked the latest snapshots here:
None of them contains the capability:

https://repository.apache.org/content/groups/snapshots/org/apache/sling/org.apache.sling.commons.metrics/

the fix/workaround would be this, but the bundle plugin should discover that 
the service are provided and I really dont understand why it's leftout:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-DocURL>
              https://sling.apache.org/documentation/bundles/metrics.html
            </Bundle-DocURL>
            <DynamicImport-Package>
              javax.servlet,
              javax.servlet.http;version="[2.3,3)",
              org.apache.commons.io.output;version="[2.4.0,3)",
              org.apache.felix.inventory;version="[1.0.0,2)"
            </DynamicImport-Package>
            <Provide-Capability>osgi.service; 
objectClass=org.apache.sling.commons.metrics.MetricsService</Provide-Capability>
          </instructions>
          <!-- Export SCR metadata to classpath to have them available in unit 
tests -->
          <exportScr>true</exportScr>
        </configuration>
        <executions>
          <!-- Configure extra execution of 'manifest' in process-classes phase 
to make sure SCR metadata is generated before unit test runs -->
          <execution>
            <id>scr-metadata</id>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <supportIncrementalBuild>true</supportIncrementalBuild>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

> Commons Metrics DOES not declare provide capability for Metrics service
> -----------------------------------------------------------------------
>
>                 Key: SLING-6474
>                 URL: https://issues.apache.org/jira/browse/SLING-6474
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>    Affects Versions: Commons Metrics 1.2.0
>            Reporter: Nino Martinez
>            Assignee: Chetan Mehrotra
>             Fix For: Commons Metrics 1.2.2
>
>
> Commons Metrics needs to declare provide capability for 
> org.apache.sling.commons.metrics.MetricsService in manifest.MF
> otherwise other bundles that specifies require capability on the 
> MetricsService will fail to start.
> AS of maven bundle plugin 3.2.0 this will become a problem, since they fixed 
> the capabilities generation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to