I've raised https://issues.apache.org/jira/browse/FELIX-532 to document the issue and attached a test case that demonstrates it.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stuart McCulloch Sent: 10 April 2008 04:12 To: [email protected] Subject: Re: maven-bundle-plugin does not import inheritance dependencies when maven-compiler-plugin is present in build On 09/04/2008, Rowe, James <[EMAIL PROTECTED]> wrote: > > Hi Stuart, > > Sorry, should've also mentioned that the problem still occurs when you > configure the maven-compiler-plugin with 1.3 or 1.4 source/target, i.e. ok - in that case a testcase is even more important because this sounds like a problem that's going to be difficult to diagnose remotely... <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > > <source>1.3</source> > <target>1.3</target> > > </configuration> > </plugin> > <plugin> > <groupId>org.apache.felix</groupId> > <artifactId>maven-bundle-plugin</artifactId> > <version>1.4.0</version> > <extensions>true</extensions> > <configuration> > <manifestLocation>META-INF</manifestLocation> > <instructions> > <Import-Package>*</Import-Package> > <Export-Package>com.bofa.ib*</Export-Package> > </instructions> > </configuration> > </plugin> > </plugins> > </build> > > > James. > > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stuart > McCulloch > Sent: 09 April 2008 15:52 > To: [email protected] > Subject: Re: maven-bundle-plugin does not import inheritance > dependencies when maven-compiler-plugin is present in build > > On 09/04/2008, Rowe, James <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm having a problem getting maven-compiler-plugin and > > maven-bundle-plugin to play nicely together. Here's the build > > section of my pom: > > > > <build> > > <plugins> > > <plugin> > > <groupId>org.apache.maven.plugins</groupId> > > <artifactId>maven-compiler-plugin</artifactId> > > <configuration> > > <source>1.5</source> > > <target>1.5</target> > > </configuration> > > </plugin> > > <plugin> > > <groupId>org.apache.felix</groupId> > > <artifactId>maven-bundle-plugin</artifactId> > > <version>1.4.0</version> > > <extensions>true</extensions> > > <configuration> > > <manifestLocation>META-INF</manifestLocation> > > <instructions> > > <Import-Package>*<Import-Package> > > <Export-Package>com.bofa.ib*</Export-Package> > > </instructions> > > </configuration> > > </plugin> > > </plugins> > > </build> > > > > When maven-compiler-plugin is explicitly added to the build, > > inheritance dependencies are not resolved. For example, our class > > uses org.springframework.jdbc.core.JdbcTemplate, which extends > > org.springframework.jdbc.support.JdbcAccessor (note the superclass > > lives in a different package). The method we invoke is defined on > > JdbcAccessor, hence the inheritance dependency. When the compiler > > plugin is included in the build, the bundle plugin fails to import > > the > > > inherited org.springframework.jdbc.support package dependency. When > > the compiler plugin is taken out of the build, the bundle plugin > > correctly imports it. Of course, leaving out the compiler plugin > > means that 1.5 source does not compile! > > > Hi James, > > the bundleplugin uses the Bnd tool to analyze bytecode, not the > source, so it may well be that when you build it with 1.5 there is > some difference in bytecode that means the inheritance doesn't appear (ie. > perhaps some optimization) > > for example, with shared static final fields, there isn't actually a > dependency between the classfiles because the javac compiler inlines > the constant value... > > One workaround is to explicitly add the inherited package dependency > in > > the Import-Package instruction, but it's a bit painful having to do > > this. Has anyone else experienced this? > > > no I've not seen this before -and it's either due to a difference in > the bytecode, or in the classpath passed to the bundleplugin from > Maven (though how the compiler plugin is affecting it I'm really not > sure, as Maven should isolate it to some extent). > > either way we'll need a recreatable testcase attached to a JIRA issue > to properly investigate - you might also want to use the -X debug > setting with both non-1.5 and 1.5 builds and see if there's any > obvious difference in the classpath used by each build. > > (redirect the debug ouput to a file, because it's very verbose) > > HTH > > Thanks, > > James. > > > > Notice to recipient: > > The information in this internet e-mail and any attachments is > > confidential and may be privileged. It is intended solely for the > addressee. > > If you are not the intended addressee please notify the sender > > immediately by telephone. If you are not the intended recipient, any > > disclosure, copying, distribution or any action taken or omitted to > > be > > > taken in reliance on it, is prohibited and may be unlawful. > > > > When addressed to external clients any opinions or advice contained > > in > > > this internet e-mail are subject to the terms and conditions > > expressed > > > in any applicable governing terms of business or client engagement > > letter issued by the pertinent Bank of America group entity. > > > > If this email originates from the U.K. please note that Bank of > > America, N.A., London Branch and Banc of America Securities Limited > > are authorised and regulated by the Financial Services Authority. > > For > > > all U.K. corporate disclosures, please refer to > > www.bankofamerica.com/ukcompanies > > > > -- > Cheers, Stuart > > > > Notice to recipient: > The information in this internet e-mail and any attachments is > confidential and may be privileged. It is intended solely for the addressee. > If you are not the intended addressee please notify the sender > immediately by telephone. If you are not the intended recipient, any > disclosure, copying, distribution or any action taken or omitted to be > taken in reliance on it, is prohibited and may be unlawful. > > When addressed to external clients any opinions or advice contained in > this internet e-mail are subject to the terms and conditions expressed > in any applicable governing terms of business or client engagement > letter issued by the pertinent Bank of America group entity. > > If this email originates from the U.K. please note that Bank of > America, N.A., London Branch and Banc of America Securities Limited > are authorised and regulated by the Financial Services Authority. For > all U.K. corporate disclosures, please refer to > www.bankofamerica.com/ukcompanies > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Cheers, Stuart Notice to recipient: The information in this internet e-mail and any attachments is confidential and may be privileged. It is intended solely for the addressee. If you are not the intended addressee please notify the sender immediately by telephone. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to external clients any opinions or advice contained in this internet e-mail are subject to the terms and conditions expressed in any applicable governing terms of business or client engagement letter issued by the pertinent Bank of America group entity. If this email originates from the U.K. please note that Bank of America, N.A., London Branch and Banc of America Securities Limited are authorised and regulated by the Financial Services Authority. For all U.K. corporate disclosures, please refer to www.bankofamerica.com/ukcompanies --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

