Thanks for the help.

I did do some simple testing and it does appear to do what I hoped it would.

I'm now using maven-bundle-plugin.  It compiles the sources correctly but
fails with:

...
[INFO] [bundle:bundle]
[ERROR] Importing packages that are never refered to by any class on the
Bundle-Classpath[Jar:dot]: [*]
[ERROR] The JAR is empty
org.apache.maven.plugin.MojoFailureException: Found errors, see log
        at
org.apache.felix.tools.maven2.bundleplugin.BundlePlugin.execute(BundlePlugin.
java:150)
...

I'm not sure where the log is supposed to be.

Maybe it'll help if I explain what I'm trying to do.  I'm working on equinox
bundles that can be edited in the Eclipse IDE.  These aren't meant for an RCP
app or anything.  They are just standard OSGi bundles with a few extra
resources (like plugin.xml, etc.)  But, to edit sources in eclipse the
manifest.mf file needs to be available (and in a META-INF directory) to the
IDE so that the editor can resolve classes (eclipse will use the manifest.mf
file for class resolution in the editor.)  It doesn't really help me if
manifest.mf doesn't exist until packaging and only then in the target
directory.  Is there any way to get a copy of the plugin-constructed manifest
file put into ${basedir}/META-INF so that eclipse is happy?

My current pom.xml looks like the following (note comments):

<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/maven-v4_0_0.xsd";>
        <modelVersion>4.0.0</modelVersion>
                <groupId>ourgroup</groupId>
        <artifactId>ourartifact</artifactId>
        <packaging>bundle</packaging>
        <version>1.0.0</version>
        <name>some name</name>
        <dependencies>
                <dependency>
                        <!--This is a bundle that is needed only for
compilation and should be added to Required-Bundles -->
                        <groupId>equinox</groupId>
                        <artifactId>apache_common_logging</artifactId>
                        <version>1.0.4</version>
                        <scope>provided</scope>
                </dependency>
                <dependency>
                        <!-- This is a bundle that is needed only for
compilation and should be added to Required-Bundles -->
                        <groupId>equinox</groupId>
                        <artifactId>servlet_api</artifactId>
                        <version>1.0.0.v20060717</version>
                        <scope>provided</scope>
                </dependency>
                <dependency>
                        <!-- All other dependencies are standard library
.jars and need to be packaged with the bundle and specified in the
Bundle-Classpath in the manifest -->
                        <groupId>jpivot</groupId>
                        <artifactId>jpivot</artifactId>
                        <version>0.0.1</version>
                </dependency>
                <dependency>
                        <groupId>jpivot</groupId>
                        <artifactId>wcf</artifactId>
                        <version>0.0.1</version>
                </dependency>
        </dependencies>
        <build>
                <sourceDirectory>${basedir}/src</sourceDirectory>
                <plugins>
                        <plugin>
                                <artifactId>maven-bundle-plugin</artifactId>
                                <groupId>org.apache.felix</groupId>
                                <version>0.8.0-SNAPSHOT</version>
                                <extensions>true</extensions>
                                <configuration>
                                </configuration>
                        </plugin>
                </plugins>
        </build>
</project>

-----Original Message-----
From: Richard S. Hall [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 30, 2006 3:23 PM
To: felix-dev@incubator.apache.org
Subject: Re: maven-osgi-plugin follow bundle dependencies?

Aaron Siri wrote:
> I'm wondering if it'll resolve classes that are in a dependency bundle.
>   

Well, I am still not clear as to what you are saying. Best way to figure it
out is to create a simple example and see if it does what you expect.

> Also, I specified my own manifest file via the <manifestFile> tag but 
> it seems to be ignored (at least nothing in that file has been put 
> into the manifest file in final .jar).
>   

Hmm. Not sure on this issue, since I never used the manifestFile option...I
always just put everything in the pom file...and now I use the new bundle
plugin...

-> richard
> -Aaron
>
> -----Original Message-----
> From: Richard S. Hall [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 30, 2006 3:02 PM
> To: felix-dev@incubator.apache.org
> Subject: Re: maven-osgi-plugin follow bundle dependencies?
>
> Aaron Siri wrote:
>   
>>  I'm wondering if the maven-osgi-plugin will properly add 
>> Bundle-Classpath entries from dependencies to the classpath when 
>> doing a
>>     
> compile?
>   
>> Specifically, can you specify a bundle as a maven dependency and have 
>> the plugin do the right thing with the classpath entries in the 
>> manifest from the dependencies when compiling.
>>     
>
> If I understand your question correctly, yes you can have the plugin 
> automatically embed your dependent JAR files inside of your bundle and 
> put them on the bundle class path. See the "Advanced Features" section 
> of this
> document:
>
>     http://cwiki.apache.org/FELIX/osgi-plugin-for-maven-2.html
>
> The new maven bundle plugin uses a different approach where you simply 
> specify which packages on the compile-time class path should be 
> include in your bundle. Its documentation is here:
>
>     http://cwiki.apache.org/FELIX/bundle-plugin-for-maven-bnd.html
>
> -> richard
>   

Reply via email to