Hi,

I just updated to maven-bundle-plugin 2.0.0. It appears that there have been a few changes to the way things compile, and I'm just discovering many interesting things in my own projects. This is of course a good thing, as it's bringing out many erroneous interpretations I made earlier.


Anyway, here's my current issue.

In project A, I have an embedded jar that I want to export. POM and bnd file below.

In project B, I want to use the embedded package, but I only want to depend on the containing bundle, not the embedded bundle. Since the containing bundle exports this, my assumption is that this should be possible.

However, the embedded jar in project A is only contained in the final installed jar, not in the target/classes directory. The problem is that maven wants to read from the target/classes directory rather than from the installed jar, so it can't find the embedded packages.


Any ideas?


Here's the essential of project A:

  <dependencies>
    <dependency>
      <groupId>org.junit</groupId>
      <artifactId>com.springsource.org.junit</artifactId>
    </dependency>
    <dependency>
      <groupId>net.jcip</groupId>
      <artifactId>com.springsource.net.jcip.annotations</artifactId>
      <version>1.0.0</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>

and the bnd file:

Export-Package: ${bundle.namespace}.*;version="${pom.version}"

Embed-Dependency: com.springsource.net.jcip.annotations;groupId=net.jcip;inline=false

Bundle-RequiredExecutionEnvironment: J2SE-1.5

-exportcontents: net.jcip.*;version="1.0"



And here's the POM from project B:

  <dependencies>
   ...
    <dependency>
      <groupId>net.leangen.expedition.util</groupId>
      <artifactId>expedition_object_api</artifactId>
      <scope>provided</scope>
    </dependency>
  ...
  </dependencies>


The output from Maven looks like this:

[DEBUG] Classpath: [/Users/dleangen/bioscene/dev/trunk/domains/lsd/ model/impl/target/classes /Users/dleangen/.m2/repository/org/osgi/org.osgi.core/4.1.0/ org.osgi.core-4.1.0.jar
 /Users/dleangen/bioscene/dev/trunk/domains/lsd/model/si/target/classes
/Users/dleangen/bioscene/dev/trunk/platform/util/object/api/target/ classes /Users/dleangen/.m2/repository/org/ops4j/pax/logging/pax-logging-api/ 1.3.0/pax-logging-api-1.3.0.jar /Users/dleangen/.m2/repository/org/osgi/org.osgi.compendium/4.1.0/ org.osgi.compendium-4.1.0.jar] [DEBUG] Output directory: /Users/dleangen/bioscene/dev/trunk/domains/ lsd/model/impl/target/classes

So, in some cases it uses the jar file from the local cache, but in others, the output in the target/classes dir.


Thanks!
=David



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to