Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bundle export of 'org.modeshape' packages #813

Closed
wants to merge 4 commits into from

Conversation

awoods
Copy link

@awoods awoods commented Jun 12, 2015

@acoburn
Copy link
Contributor

acoburn commented Jun 12, 2015

👍 This builds properly for me!

@acoburn
Copy link
Contributor

acoburn commented Jun 13, 2015

No, actually, I don't think this is entirely correct. The fcrepo-kernel-impl package is still generating a split-package.

@awoods
Copy link
Author

awoods commented Jun 14, 2015

@acoburn, can you please describe the process by which you determine if the bundle generates a "split-package"?
Also, these org.modeshape packages/services should not be used by any other bundle in F4 besides fcrepo-kernel-impl. I would hope an easy fix would be to simply eliminate the export of these packages/services from the fcrepo-kernel-impl bundle in the OSGi context.

@acoburn
Copy link
Contributor

acoburn commented Jun 15, 2015

@awoods, there are several ways to ascertain this. The easiest is by noting the warning from the build machinery (maven-bundle-plugin) along these lines:

[WARNING] Bundle org.fcrepo:fcrepo-kernel-impl:bundle:4.2.1-SNAPSHOT : Split package, multiple jars provide the same package:org/modeshape/jcr
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:., Jar:modeshape-jcr]
Class path         [Jar:., Jar:modeshape-jcr, Jar:modeshape-jcr-api, Jar:jcr, Jar:modeshape-common, Jar:joda-time, Jar:modeshape-schematic, Jar:jgroups, Jar:mapdb, Jar:tika-core, Jar:jbossjta, Jar:fcrepo-kernel, Jar:jena-core, Jar:jena-iri, Jar:xercesImpl, Jar:xml-apis, Jar:jena-arq, Jar:jsonld-java, Jar:jackson-core, Jar:httpclient-cache, Jar:libthrift, Jar:commons-lang3, Jar:commons-csv, Jar:javax.inject, Jar:guava, Jar:slf4j-api, Jar:jcl-over-slf4j, Jar:spring-context, Jar:spring-aop, Jar:aopalliance, Jar:spring-beans, Jar:spring-core, Jar:spring-expression, Jar:fcrepo-metrics, Jar:metrics-core, Jar:metrics-graphite, Jar:metrics-jersey2, Jar:metrics-servlets, Jar:metrics-healthchecks, Jar:metrics-json, Jar:metrics-jvm, Jar:jackson-databind, Jar:jackson-annotations, Jar:jena-tdb, Jar:commons-lang, Jar:fcrepo-mint, Jar:httpclient, Jar:httpcore, Jar:commons-codec, Jar:metrics-annotation, Jar:commons-io, Jar:infinispan-core, Jar:jboss-transaction-api_1.1_spec, Jar:jboss-marshalling-river, Jar:jboss-marshalling, Jar:jboss-logging, Jar:infinispan-commons]
[WARNING] Bundle org.fcrepo:fcrepo-kernel-impl:bundle:4.2.1-SNAPSHOT : Split package, multiple jars provide the same package:org/modeshape/jcr/value/binary/infinispan
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:., Jar:modeshape-jcr]
Class path         [Jar:., Jar:modeshape-jcr, Jar:modeshape-jcr-api, Jar:jcr, Jar:modeshape-common, Jar:joda-time, Jar:modeshape-schematic, Jar:jgroups, Jar:mapdb, Jar:tika-core, Jar:jbossjta, Jar:fcrepo-kernel, Jar:jena-core, Jar:jena-iri, Jar:xercesImpl, Jar:xml-apis, Jar:jena-arq, Jar:jsonld-java, Jar:jackson-core, Jar:httpclient-cache, Jar:libthrift, Jar:commons-lang3, Jar:commons-csv, Jar:javax.inject, Jar:guava, Jar:slf4j-api, Jar:jcl-over-slf4j, Jar:spring-context, Jar:spring-aop, Jar:aopalliance, Jar:spring-beans, Jar:spring-core, Jar:spring-expression, Jar:fcrepo-metrics, Jar:metrics-core, Jar:metrics-graphite, Jar:metrics-jersey2, Jar:metrics-servlets, Jar:metrics-healthchecks, Jar:metrics-json, Jar:metrics-jvm, Jar:jackson-databind, Jar:jackson-annotations, Jar:jena-tdb, Jar:commons-lang, Jar:fcrepo-mint, Jar:httpclient, Jar:httpcore, Jar:commons-codec, Jar:metrics-annotation, Jar:commons-io, Jar:infinispan-core, Jar:jboss-transaction-api_1.1_spec, Jar:jboss-marshalling-river, Jar:jboss-marshalling, Jar:jboss-logging, Jar:infinispan-commons]
[WARNING] Bundle org.fcrepo:fcrepo-kernel-impl:bundle:4.2.1-SNAPSHOT : Export org.fcrepo.kernel.impl.services.functions,  has 1,  private references [org.modeshape.jcr.value.binary.infinispan], 
[WARNING] Bundle org.fcrepo:fcrepo-kernel-impl:bundle:4.2.1-SNAPSHOT : Export org.fcrepo.kernel.impl.spring,  has 1,  private references [org.modeshape.jcr], 
[WARNING] Bundle org.fcrepo:fcrepo-kernel-impl:bundle:4.2.1-SNAPSHOT : Export org.fcrepo.kernel.impl.utils.impl,  has 1,  private references [org.modeshape.jcr.value.binary.infinispan], 

Next, you can manually inspect the jar:

$ jar -tvf target/fcrepo-kernel-impl-4.2.1-SNAPSHOT.jar

and see which classes it exports

And finally, you can install the bundle in karaf (drop it in $KARAF_HOME/deploy) and then list the classes that are exported

$ bundle:list
$ bundle:classes <bundle id>

(the exported classes are in bold)

@acoburn
Copy link
Contributor

acoburn commented Jun 16, 2015

awoods I issued a PR against your branch that should address this issue. The code still breaks through the modeshape package layer, but there is no longer a split package.

@acoburn
Copy link
Contributor

acoburn commented Jun 18, 2015

Resolved via 7fefb02

@acoburn acoburn closed this Jun 18, 2015
@awoods awoods deleted the fcrepo-1535 branch June 18, 2015 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants