You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Rowe, James" <ja...@bankofamerica.com> on 2008/04/09 16:17:45 UTC

maven-bundle-plugin does not import inheritance dependencies when maven-compiler-plugin is present in build

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!
 
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?
 
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


Re: maven-bundle-plugin does not import inheritance dependencies when maven-compiler-plugin is present in build

Posted by Stuart McCulloch <st...@jayway.net>.
On 10/04/2008, Rowe, James <ja...@bankofamerica.com> wrote:
>
> I've raised https://issues.apache.org/jira/browse/FELIX-532 to document
> the issue and attached a test case that demonstrates it.


thanks, I've added several comments: basically there is a difference in
the bytecode between target=1.1 and target=1.2 due to a clarification
in the JVM spec which says you don't need to reference the abstract
base class when calling it's methods (because the JVM searches the
hierarchy).

so it looks like Bnd is behaving properly - the question I need to ask
is whether this has caused any errors when deploying onto an actual
OSGi framework, or are you seeing the error in Eclipse/PDE?

-----Original Message-----
> From: mcculls@gmail.com [mailto:mcculls@gmail.com] On Behalf Of Stuart
> McCulloch
>
> Sent: 10 April 2008 04:12
> To: users@felix.apache.org
> Subject: Re: maven-bundle-plugin does not import inheritance
> dependencies when maven-compiler-plugin is present in build
>
> On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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: mcculls@gmail.com [mailto:mcculls@gmail.com] On Behalf Of Stuart
>
> > McCulloch
> > Sent: 09 April 2008 15:52
> > To: users@felix.apache.org
> > Subject: Re: maven-bundle-plugin does not import inheritance
> > dependencies when maven-compiler-plugin is present in build
> >
> > On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
>
>
> --
> 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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart

RE: maven-bundle-plugin does not import inheritance dependencies when maven-compiler-plugin is present in build

Posted by "Rowe, James" <ja...@bankofamerica.com>.
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: mcculls@gmail.com [mailto:mcculls@gmail.com] On Behalf Of Stuart
McCulloch
Sent: 10 April 2008 04:12
To: users@felix.apache.org
Subject: Re: maven-bundle-plugin does not import inheritance
dependencies when maven-compiler-plugin is present in build

On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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: mcculls@gmail.com [mailto:mcculls@gmail.com] On Behalf Of Stuart

> McCulloch
> Sent: 09 April 2008 15:52
> To: users@felix.apache.org
> Subject: Re: maven-bundle-plugin does not import inheritance 
> dependencies when maven-compiler-plugin is present in build
>
> On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


--
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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: maven-bundle-plugin does not import inheritance dependencies when maven-compiler-plugin is present in build

Posted by Stuart McCulloch <st...@jayway.net>.
On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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: mcculls@gmail.com [mailto:mcculls@gmail.com] On Behalf Of Stuart
> McCulloch
> Sent: 09 April 2008 15:52
> To: users@felix.apache.org
> Subject: Re: maven-bundle-plugin does not import inheritance
> dependencies when maven-compiler-plugin is present in build
>
> On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart

RE: maven-bundle-plugin does not import inheritance dependencies when maven-compiler-plugin is present in build

Posted by "Rowe, James" <ja...@bankofamerica.com>.
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.

  <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: mcculls@gmail.com [mailto:mcculls@gmail.com] On Behalf Of Stuart
McCulloch
Sent: 09 April 2008 15:52
To: users@felix.apache.org
Subject: Re: maven-bundle-plugin does not import inheritance
dependencies when maven-compiler-plugin is present in build

On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: maven-bundle-plugin does not import inheritance dependencies when maven-compiler-plugin is present in build

Posted by Stuart McCulloch <st...@jayway.net>.
On 09/04/2008, Rowe, James <ja...@bankofamerica.com> 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