On 7 Nov 2011, at 01:04, Adrien Ragot wrote: > On Thu, Nov 3, 2011 at 11:56 PM, Stuart McCulloch <[email protected]> wrote: >> On 3 Nov 2011, at 04:37, Adrien Ragot wrote: >> >>> Hi, >>> >>> I'm trying to upgrade from maven-bundle-plugin 2.2.0 to 2.3.4 (they >>> both use Bnd-1.15.0), and I'm checking there is no regression in the >>> generated MANIFEST.MF. >>> As far as I can see, Import-Package is not calculated as I expected. I >>> suspect Bundle-ClassPath is not read anymore. Was there any change in >>> this revision? >> >> The main change affecting the manifest goal between 2.2.0 and 2.3.4 was to >> use the "supportedProjectTypes" parameter to decide whether to use the BND >> builder approach (which uses the given instructions to assemble the content >> and in doing so generates the manifest) versus using the BND analyzer >> approach (which looks for an existing archive attached to the project and >> extrapolates the manifest from its contents). The difference in the final >> manifest is all to do with how these two approaches analyze the project >> classpath. For example, since there's no instruction to include the >> dependency jar mentioned in the Bundle-ClassPath in the bundle and that jar >> is not located relative to the project, > > Is there a way to do it? > My only goal is to write the manifest. We don't use BND's builder, we > just use it to create the archive. > > As I understand, this would make BND consider all Maven dependencies > are part of the classpath to analyze. If I want to strictly keep the > former manifest, I can get rid of the Embed-Dependency header using > _removeheaders: > > <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> > > <_removeheaders>Include-Resource,Private-Package,Embed-Dependency</_removeheaders> > (and no Bundle-ClassPath anymore) > > The drawback is it writes the Bundle-ClassPath differently (it writes > myjar.jar, instead of our WEB-INF/lib/myjar.jar).
Note you can use Embed-Directory to put the dependency under a specific directory, and Embed-StripVersion to remove the version. There is also the -wab instruction (or <_wab> in XML) which adds WEB-INF/classes to the bundle classpath instead of the default "." > Is there a way to prevent BND from modifying the Bundle-ClassPath header we > write? > Can you foresee any drawback of using this method? Do you still want > me to raise an issue? Tweaking the BND instructions so it builds (in memory) the same archive that you already have in order to get the right manifest will always be more fragile than simply taking the existing archive and generating a manifest. So please do open an issue describing this use-case, then I can bring back the old behaviour and introduce a switch to toggle between the two behaviours. > Thank you, > Adrien > > --------------------------------------------------------------------- > 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]

