I must be missing something here. My attempts to import a wrapper bundle still lead to a run-time ClassNotFoundException when I try to debug the sample application that is attached.
I've reduced the BundleGuava project down to just a pom.xml file. This eliminated the .project, .classpath, and META-INF/MANIFEST files that had been present in the project. I think this packaging is identical to the packaging for the itp02/build01/pomfirst-thirdparyt/pom.xml. I do not have any project that resembles the itp02/build01/pomfirst-bundle/pom.xml.
When I import the BundleGuava project as an existing Maven project, the .project and .classpath files where created from scratch. The Tycho and Eclipse compilers seem happy with this arrangement.
However, when I try to launch the BundleUser as an Eclipse application, I get this exception:
java.lang.NoClassDefFoundError: com/google/common/base/Joiner
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Joiner cannot be found by BundleUser_1.0.0.qualifier
Although I've imported BundleGuava as an Existing Maven Project, the IDE does not seem to recognize it as a project that can be added to the build. I note that is is not listed in the Debug Configuration page for Plugins. Although I can add it a a project for the build dependencies, it does not seem to be recognized as a Workspace plugin.
I sure I'm omitting one essential Maven attribute on some configuration page. And I'd sure appreciate some help figuring out which attribute thats.
(I'm using Guava as an example. In my RPC application, I have a large number of more exotic libraries. Regardless, I look forward to using an externally packaged Guava in the future.)
Here's the pom.xml for BundleGuava:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.demo.bundle</groupId>
<artifactId>bundle-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../bundle-parent/pom.xml</relativePath>
</parent>
<artifactId>BundleGuava</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<guava.version>18.0</guava.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.5.3</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<_nouses>true</_nouses>
<_exportcontents>com.google.common.*</_exportcontents>
<_removeheaders>
Import-Package,
Embed-Dependency,
Embedded-Artifacts,
Private-Package
</_removeheaders>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>