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

Eric Norman edited comment on SLING-9218 at 3/19/20, 5:59 PM:
--------------------------------------------------------------

[~kwin] I gave the 1.2.1-SNAPSHOT a try, but unfortunately I now get the 
following new error from bnd-maven-plugin during the maven build.

Caused by: org.apache.maven.plugin.MojoFailureException: Contracts [Contract 
[name=JavaJSONP;version=1.1.0;from=org.apache.sling.commons.johnzon-1.2.1-SNAPSHOT],
 Contract [name=JavaJSONP;version=1.1.0;from=geronimo-json_1.1_spec-1.3]] 
declare the same packages in their uses: directive: [javax.json]. Contracts are 
found in declaring bundles (see their 'from' field), it is possible to control 
the findingwith the -contract instructionCaused by: 
org.apache.maven.plugin.MojoFailureException: Contracts [Contract 
[name=JavaJSONP;version=1.1.0;from=org.apache.sling.commons.johnzon-1.2.1-SNAPSHOT],
 Contract [name=JavaJSONP;version=1.1.0;from=geronimo-json_1.1_spec-1.3]] 
declare the same packages in their uses: directive: [javax.json]. Contracts are 
found in declaring bundles (see their 'from' field), it is possible to control 
the findingwith the -contract instruction at 
aQute.bnd.maven.plugin.BndMavenPlugin.reportErrorsAndWarnings(BndMavenPlugin.java:597)
 at aQute.bnd.maven.plugin.BndMavenPlugin.execute(BndMavenPlugin.java:438) at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 

 

By the way, this error goes away if I also make the change suggested in my 
first comment by changing the org.apache.sling.commons.johnzon pom.xml to 
define the scope of the geronimo-json_1.1_spec dependency to "provided" so it 
doesn't bleed into the maven dependency tree that BND appears to be processing. 
 Is that a change that you would be comfortable with?

 


was (Author: enorman):
[~kwin] I gave the 1.2.1-SNAPSHOT a try, but unfortunately I now get the 
following new error from bnd-maven-plugin during the maven build.

Caused by: org.apache.maven.plugin.MojoFailureException: Contracts [Contract 
[name=JavaJSONP;version=1.1.0;from=org.apache.sling.commons.johnzon-1.2.1-SNAPSHOT],
 Contract [name=JavaJSONP;version=1.1.0;from=geronimo-json_1.1_spec-1.3]] 
declare the same packages in their uses: directive: [javax.json]. Contracts are 
found in declaring bundles (see their 'from' field), it is possible to control 
the findingwith the -contract instructionCaused by: 
org.apache.maven.plugin.MojoFailureException: Contracts [Contract 
[name=JavaJSONP;version=1.1.0;from=org.apache.sling.commons.johnzon-1.2.1-SNAPSHOT],
 Contract [name=JavaJSONP;version=1.1.0;from=geronimo-json_1.1_spec-1.3]] 
declare the same packages in their uses: directive: [javax.json]. Contracts are 
found in declaring bundles (see their 'from' field), it is possible to control 
the findingwith the -contract instruction at 
aQute.bnd.maven.plugin.BndMavenPlugin.reportErrorsAndWarnings(BndMavenPlugin.java:597)
 at aQute.bnd.maven.plugin.BndMavenPlugin.execute(BndMavenPlugin.java:438) at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 

 

By the way, this error goes away if I also make the change suggested in my 
first comment by changing the org.apache.sling.commons.johnzon pom.xml to 
define the scope of the geronimo-json_1.1_spec dependency to "provided" so it 
doesn't bleed into the maven dependency tree that BND appears to be procesing.  
Is that a change that you would be comfortable with?

 

> Incomplete OSGi manifest for Commons Johnzon 1.2.0
> --------------------------------------------------
>
>                 Key: SLING-9218
>                 URL: https://issues.apache.org/jira/browse/SLING-9218
>             Project: Sling
>          Issue Type: Bug
>    Affects Versions: Commons Johnzon 1.2.0
>            Reporter: Eric Norman
>            Assignee: Konrad Windszus
>            Priority: Major
>             Fix For: Commons Johnzon 1.2.2
>
>
> It looks to me that any bundle that attempts to depend on the new 
> org.apache.sling.commons.johnzon:1.2.0 bundle produces a manifest for the new 
> bundle that makes it not activate when deployed to the sling runtime.
>   
>  For example, the manifest now includes this instruction in the manifest:
>   
> {quote}Require-Capability: osgi.contract;osgi.contract=JavaJSONP;filter:="(&(
>   osgi.contract=JavaJSONP)(version=1.1.0))",osgi.ee;filter:="(&(osgi.ee
>   =JavaSE)(version=1.8))"
> {quote}
>  
>   
>  But it doesn't look like the org.apache.sling.commons.johnzon:1.2.0 manifest 
> declares that it provides that JavaJSONP capability.
>   
>  It appears that the equivalent "Provide-Capability" instruction is in the 
> original org.apache.geronimo.specs.geronimo-json_1.1_spec artifact.  It 
> contains the following in it's manifest but the o.a.s.commons.johnzon does 
> not do the same when it wraps the bundle:
>   
> {quote}Provide-Capability: osgi.contract;osgi.contract=JavaJSONP;uses:="javax
>   .json,javax.json.spi,javax.json.stream";version:List<Version>="1.1,1.
>   0"
> {quote}
>  
>  
> Alternatively, maybe there is a convenient way to adjust the BND instructions 
> so one can depend on the org.apache.sling.commons.johnzon:1.2.0 artifact 
> without requiring the osgi.contract=JavaJSONP capability in the manifest?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to