I've just started with this maven plugin to develop OSGi bundles, but I
cannot make it work.
I've followed this document:
http://cwiki.apache.org/confluence/display/FELIX/Maven+Bundle+Plugin+%28BND%29

Whenever I include: <packaging>bundle</packaging> in the pom.xml, the build
plan is empty and it doesn't do anything (although the build says to be
successful). If I replace it by: <packaging>jar</packaging> the JAR file is
created (although with the typical manifest file that is useless for OSGi).

This is the pom.xml that I've used for a very simple example:

=======================================================
<?xml version="1.0" encoding="UTF-8"?><project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>PruebaMvn</groupId>
  <artifactId>PruebaMvn</artifactId>
  <packaging>bundle</packaging>
  <name>Prueba de OSGi Maven</name>
  <version>0.0.1-SNAPSHOT</version>
  <description></description>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>osgi_R4_core</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>1.0.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>prueba.api</Export-Package>
            <Private-Package>prueba.impl</Private-Package>
            <Bundle-Activator>prueba.impl.PruebaActivator</Bundle-Activator>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
=======================================================

And this is the maven output:

=======================================================
[DEBUG] Reading global settings from: E:\java\apache-
maven-2.0.8\conf\settings.xml
[DEBUG] Reading user settings from: null
[DEBUG] Settings file is null. Returning null.
[DEBUG] Reading global settings from: E:\java\apache-
maven-2.0.8\conf\settings.xml
[DEBUG] Reading user settings from: null
[DEBUG] Settings file is null. Returning null.
[DEBUG] Pre-scanning POM lineage of:
E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\pom.xml for build
extensions.
[DEBUG] Building model-lineage for:
E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\pom.xml to pre-scan for
extensions.
[DEBUG] Checking for external profiles in:
E:\java\eclipse_new\eclipse\pruebaMvn\profiles.xml
[DEBUG] Checking: PruebaMvn:PruebaMvn:bundle:0.0.1-SNAPSHOT for extensions.
(It has 0 modules.)
[DEBUG] Basedir is: E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn
[DEBUG] Finished pre-scanning:
E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\pom.xml for build
extensions.
[DEBUG] Building profile manager for model: [inherited]:null:jar:[inherited]
with pom file: E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\pom.xml
[DEBUG] Checking for external profiles in:
E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\profiles.xml
[DEBUG] Checking for external profiles in:
E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\profiles.xml
[DEBUG] Building profile manager for model: PruebaMvn:PruebaMvn:bundle:
0.0.1-SNAPSHOT with pom file:
E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\pom.xml
[DEBUG] Checking for external profiles in:
E:\java\eclipse_new\eclipse\pruebaMvn\PruebaMvn\profiles.xml
[DEBUG] Building profile manager for model: PruebaMvn:PruebaMvn:bundle:
0.0.1-SNAPSHOT with external profile manager including profiles: {}
[INFO] Scanning for projects...
[INFO]
----------------------------------------------------------------------------
[INFO] Building Prueba de OSGi Maven
[INFO]    task-segment: [install]
[INFO]
----------------------------------------------------------------------------
[DEBUG]

Our build plan is:



[INFO]
----------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL PruebaMvn:PruebaMvn:bundle:0.0.1-SNAPSHOT (
task-segment: [install] )
[INFO]
----------------------------------------------------------------------------
[INFO] Total time: 0 second
[INFO] Finished at: Thu Dec 13 20:35:02 CET 2007
[INFO] Memory 2M/4M
[INFO]
----------------------------------------------------------------------------
=======================================================


Thanks in advance,
Jaime

Reply via email to