Yes, but if you use bnd say from ant using a bnd.bnd file for configuration, the Private-Package instruction ends up in the manifest too unless you explicitly tell bnd to leave it out.
I would guess that the bundle plugin wrapping of bnd explicitly leaves out Private-Package from the generated manifest, but I didn't check the code. It's somewhat academic since Private-Package has no meaning to the osgi framework, just to bnd while it computes your manifest. FWIW I think there's a surprisingly large impedance mismatch between maven and osgi. I would definitely also look into bndtools. thanks davdi jencks On Aug 21, 2013, at 11:45 PM, Dawid Loubser <[email protected]> wrote: > Hi, > > This is correct. If you mark a package as "private" it should not show > up in the JAR manifest. Those classes can only be used by other classes > inside this bundle. > > What are you expecting to see? "Export-Package" in the manifest is not > transitive, i.e. sub-packages are not exported just because a parent > package is exported. Your "abc.projectx.bundlex.internal" is not > available to other bundles in your manifest below, otherwise it would be > explicitly listed in the exported packages. > > kind regards, > > -- > Dawid Loubser <[email protected]> > > Op Wo, 2013-08-21 om 15:38 -0700 skryf bokie: >> Hi, >> >> I'm currently experimenting with the Bundle Plugin for Maven >> <http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html> . >> I essentially want to learn maven and at the same time get a feel for and >> weigh the PROS and CONS of developing OSGi solutions "The Maven Way". >> >> I've created a small Maven type project in Eclipse, edited the pom.xml file >> to look like: >> >> ============= >> <project xmlns="http://maven.apache.org/POM/4.0.0" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> http://maven.apache.org/xsd/maven-4.0.0.xsd"> >> <modelVersion>4.0.0</modelVersion> >> <groupId>abc.projectx</groupId> >> <artifactId>bundlex</artifactId> >> <packaging>bundle</packaging> >> <version>1.0.0</version> >> <dependencies> >> <dependency> >> <groupId>org.osgi</groupId> >> <artifactId>core</artifactId> >> <version>4.3.1</version> >> </dependency> >> <dependency> >> <groupId>org.osgi</groupId> >> <artifactId>cmpn</artifactId> >> <version>4.3.1</version> >> </dependency> >> </dependencies> >> <build> >> <plugins> >> <plugin> >> <groupId>org.apache.felix</groupId> >> <artifactId>maven-bundle-plugin</artifactId> >> <version>2.4.0</version> >> <extensions>true</extensions> >> <configuration> >> <instructions> >> >> <Bundle-Activator>abc.projectx.bundlex.internal.Activator</Bundle-Activator> >> <Private-Package>abc.projectx.bundlex.internal</Private-Package> >> <Export-Package>abc.projectx.bundlex</Export-Package> >> </instructions> >> </configuration> >> </plugin> >> </plugins> >> </build> >> </project> >> ============= >> When I right click the pom.xml file > Run As > Maven Build... > Goals: >> bundle:bundle, everything looks fine except for the Private-Package which >> seems to be ignored (I don't see it in the final MANIFEST.MF) >> >> ============= >> Manifest-Version: 1.0 >> Bnd-LastModified: 1377123088222 >> Build-Jdk: 1.7.0_25 >> Built-By: User >> Bundle-Activator: abc.projectx.bundlex.internal.Activat >> or >> Bundle-ManifestVersion: 2 >> Bundle-Name: bundlex >> Bundle-SymbolicName: abc.projectx.bundlex >> Bundle-Version: 1.0.0 >> Created-By: Apache Maven Bundle Plugin >> Export-Package: abc.projectx.bundlex;version="1.0.0" >> Import-Package: org.osgi.framework;version="[1.6,2)" >> Tool: Bnd-2.1.0.20130426-122213 >> ============= >> >> >> >> >> >> >> -- >> View this message in context: >> http://apache-felix.18485.x6.nabble.com/Maven-tp5004631.html >> Sent from the Apache Felix - Users mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

