When I switched to newer version of plugin, I had a package uses conflict and noticed that the new version doesn't import exports. I easily solved the problem, but I was just wondering what's the reason for the new behavior. Thanks for the explanation.
Vladimir On Wed, Jun 1, 2011 at 3:47 PM, Richard S. Hall <[email protected]>wrote: > On 6/1/11 9:08, Stuart McCulloch wrote: > >> On 1 Jun 2011, at 13:45, Vladimir Stevanovic wrote: >> >> I noticed that in the version 2.2.0 (and later) there is no automatic >>> import >>> of the exprorted packages in the current bundle. I even tried to use >>> <Import-Package>*;-noimport:=false</Import-Package>, but it doesn't help. >>> If >>> the plugin version is set to 2.1.0, all exported packages are imported. >>> Is there any way to fix this, some new bnd instruction maybe? >>> >> 2.2.0 and later use a new version of Bnd, which uses the following rules >> to decide whether to import an exported package: >> >> "An export is automatically imported when the following are true: >> * There exists at least one reference to the exported package from a >> private package >> * The exported package has no references to any private packages >> * The exported package does not have a -noimport: directive." >> >> [ from: http://www.aqute.biz/Bnd/Versioning ] >> >> Is there a particular problem caused by the lack of imports, or do you >> just prefer to always import your exported packages? >> > > Just for some background info, always importing your exports leads to odd > situations. For example, if you are simply providing a library bundle, then > importing your exports doesn't really make sense because it will often > result in your exported packages being shadowed (and thus unavailable to > anyone) if another newer version is available. > > Additionally, if there are internal implementation dependencies on your > exported packages, then importing them will likely break your bundle. > > The new rules above try to more accurately detect these sorts of > situations. > > -> richard > > > Note that you can always try a later version of Bnd with the current >> bundleplugin as follows: >> >> <plugin> >> <groupId>org.apache.felix</groupId> >> <artifactId>maven-bundle-plugin</artifactId> >> <version>2.3.4</version> >> <dependencies> >> <dependency> >> <groupId>biz.aQute</groupId> >> <artifactId>bndlib</artifactId> >> <version>1.43.0</version> >> </dependency> >> </dependencies> >> <configuration> >> <!-- ...etc... --> >> </plugin> >> >> Just in case Peter releases an updated version that you want to test and >> you can't wait for a bundleplugin release. >> >> Vladimir >>> >> >> --------------------------------------------------------------------- >> 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] > >

