Thank you for your reply, but I was unclear about the issue.
My pom isn't actually creating a bundle but a jar and an assembly. The
presence of the maven-bundle-plugin in the build/plugins section changes
what the assembly plugin considers part of the runtime-dependencySet,
without the plugin this includes the main jar built by the
maven-jar-plugin with the plugin it includes a jar containing the tests
instead of the main jar.
I come across this because we are using a parent-pom for all our
projects (which are mostly of packaging 'bundle') which includes the
maven-bundle-plugin.
Regards, Clemens
Stuart McCulloch wrote:
2008/11/27 Clemens Wilding <[EMAIL PROTECTED]>
Hello,
To create a bundle, I use the org.apache.felix maven-bundle-plugin and the
maven-assembly-plugin. As the bundle depends
on another bundle, I specify with the assembly-plugin to install the
required bundle in a specified folder. This works fine.
Now if I don't use the maven-bundle-plugin, the generated jar is included
in the specified folder. But if I use the plugin,
only a test jar is installed in this folder. I don't know if this is a
desired behaviour or maybe a little bug, so I wrote this mail.
this is working as designed...
the maven-bundle-plugin is different to the maven-jar-plugin in that it does
not simply
jar up the contents of "target/classes" - instead it follows a recipe of
instructions that
define the desired content (ie.
Export-Package/Private-Package/Include-Resource)
http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
this is because we use the Bnd tool to generate the bundle, and this tool is
designed
to pull classes and resources from a classpath into one or more bundles,
effectively
slicing the classpath into different bundles
the maven-bundle-plugin will try to map certain Maven conventions into the
relevant
Bnd instructions (for example src/main/resources -> Include-Resource)
automatically
and there are instructions that work on Maven dependencies
(Embed-Dependency)
- but it cannot know in this situation that it needs to include the file
unless you tell it
so if you want to add dependencies to the bundle you can use
Embed-Dependency:
<Embed-Dependency>*;scope=runtime;inline=false</Embed-Dependency>
<Embed-Directory>lib</Embed-Directory>
or you can continue with the assembly plugin and use Include-Resource to add
them
(see http://www.aqute.biz/Code/Bnd#include-resource for more detailed
instructions)
HTH
As you might need some information about my configuration, I provide some
information about the pom.xml and the assembly file dist.xml.
Regards, Clemens
pom.xml:
<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>org.example.trialox.scb</groupId>
<artifactId>tutorial1</artifactId>
<packaging>jar</packaging>
<version>0.7-SNAPSHOT</version>
<name>tutorial1</name>
<dependencies>
<dependency>
<groupId>org.trialox</groupId>
<artifactId>org.trialox.rdf.core</artifactId>
<version>0.4-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/dist.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.example.trialox.scb.tutorial1.App</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<!-- <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin> -->
</plugins>
</build>
</project>
dist.xml:
<assembly>
<id>dist</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]