On 09/04/2008, Tim Moloney <[EMAIL PROTECTED]> wrote:
>
> I wasn't intentionally using the foundation jar.  I was only vaguely aware
> of its existence.  I am using the compendium jar which has the foundation
> jar as a dependency.  Apparently, this is causing Eclipse/Q4E/Maven to put
> the foundation jar earlier in the classpath.  As a result, Eclipse is using
> the java.* classes that don't have generics.  Since my bundles will be
> running in a Java SE 6 execution environment, I'd like to not use the
> foundation jar (even for compiling) but the dependencies are there
> regardless.


ok, that makes more sense - those dependencies in the compendium
jar should probably be made optional, to avoid them being dragged in
onto the compilation classpath of other projects, ie in the compendium
pom we'd use something like:

    <dependency>
      <!-- normal stuff -->
      <optional>true</optional>
    </dependency>
    <!-- etc -->

for now one workaround is to exclude the foundation jar in your pom:

    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <version>1.0.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.felix</groupId>
          <artifactId>org.osgi.foundation</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

or use the official OSGi compendium bundle (which I tend to use)

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>osgi_R4_compendium</artifactId>
      <version>1.0</version>
    </dependency>

HTH

>
> Here are the relevant links.
>
>
> http://groups.google.com/group/q4e-users/browse_thread/thread/35ee3462e7e59182
>
>
> http://code.google.com/p/q4e/issues/detail?id=328&can=4&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Patch
> - Comment 6 mentions org.osgi.core but I believe he meant
> org.osgi.foundation


yep - fixing the classpath by using the official compendium
bundle, or by excluding the foundation jar should then work

-- 
Cheers, Stuart

Reply via email to