Reposted; first one got buried somewhere.

I'm using felix's maven plugin to build OSGI apps in eclipse. I understand OSGI overall but the tools chain is driving me nuts.

What I don't understand is the interaction between pom.xml, the felix maven plugin, MANIFEST.MF, and the "Organize Manifest Wizard" in eclipse. And should META-INF be in the bundle root or src/main/resources? Putting a copy in src/... does seem to be noticed there but breaks everything, including command line builds. Apparently due to a broken com.ibm.icu.something according to posted bugs.

My mental model is the pom is the input and MANIFEST.MF is produced by felix maven plugin based on that pom. This model seems inaccurate somehow. Felix maven plugin's output is voluminous with lots of broken references which eclipse's "organize manifest wizard" seems there to repair. Where do the bogus references come from? In practice, it seems necessary for me to do further repairs to MANIFEST.MF by hand, but these seem to somehow persist after I change the pom (thus the conflict with my mental model).

There also seems to be vast differences between running mvn install in the command line and running the same thing in eclipse. Using the command line then importing into eclipse results in bundles that are broken in eclipse and another round of whack a mole to sort things out again. This often results in multiply-defined jar errors with the same jar in "PDE Dependencies" and "Maven Dependencies". Removing PDE dependencies in build settings seems to sort that out; sometimes.

The specific problem I'm struggling with is org.osgi.framework.BundleException: The activator com.gestalt.soakit.core.CoreActivator for bundle soakit.core is invalid when that class is definitely defined. I think this means there's a conflict between the BundleActivator class from OSGI vs Equinox, but nothing I've tried seems to repair it (importing org.eclipse.osgi.everything, not org.osgi.whatever).

The main problem here is that I'm confused about how the tools chain works; broken mental model. Can someone set me straight?

Here's one of the key poms.

<?xml version="1.0" encoding="UTF-8"?>
<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>soakit</groupId>
  <artifactId>soakit.core</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>soakit.core</name>
<description>SoaKit Core Abstraction Layer. Defines interfaces and abstract classes for the components defined in sub-modules. Provides a factory class for defining soakit composites with an XML configuration file.</description>
  <packaging>bundle</packaging>

  <parent>
    <groupId>soakit</groupId>
    <artifactId>soakit</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <dependencies>
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.2</version>
    </dependency>
        <dependency>
            <groupId>jdom</groupId>
            <artifactId>jdom</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.parsers</groupId>
            <artifactId>jaxp-api</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.1-1</version>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.8.1</version>
        </dependency>
     <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>osgi</artifactId>
            <version>3.4.0.v20080605-1900</version>
    </dependency>
    <dependency>
            <groupId>jaxen</groupId>
          <artifactId>jaxen</artifactId>
          <version>1.1-beta-9</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>.</directory>
        <includes>
          <include>plugin.xml</include>
        </includes>
      </resource>
    </resources>

    <plugins>
            <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <pde>true</pde>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>1.4.3</version>
        <extensions>true</extensions>
        <configuration>
                    <unpackBundle>true</unpackBundle>
          <manifestLocation>META-INF</manifestLocation>
          <instructions>
            <Bundle-Version>${pom.version}</Bundle-Version>
            <Bundle-Name>${artifactId}</Bundle-Name>
            <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Description>Soakit Core Bundle</Bundle-Description>

<Bundle-Activator>com.gestalt.soakit.core.CoreActivator</Bundle-Activator>

<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
            <Embed-Directory>target/dependency</Embed-Directory>
                        <_failok/>

<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
            <Import-Package>
                .,
                            *;-split-package:=merge-first,

org.apache.commons.collections.*;-split-package:=merge-first;version="3.2"

org.apache.commons.collections.iterators.*;-split-package:=merge-first;version="3.2",

org.jdom;-split-package:=merge-first;version="1.0",

org.jdom.*;-split-package:=merge-first;version="1.0",

org.jdom.input.*;-split-package:=merge-first;version="1.0",

org.jdom.output.*;-split-package:=merge-first;version="1.0",

org.apache.xerces.parsers;-split-package:=merge-first,
                            <!--
                            javax.*;-split-package:=merge-first,
                            javax.jws.*;-split-package:=merge-first,
                            javax.xml.bind.*;-split-package:=merge-first,
                            javax.annotation.*;-split-package:=merge-first,
                            javax.xml.soap.*;-split-package:=merge-first,
                            javax.xml.stream.*;-split-package:=merge-first,
                            javax.activation.*;-split-package:=merge-first,
                            -->
                        </Import-Package>
            <Export-Package>
                .,
                            *;-split-package:=merge-first,

org.apache.commons.collections.*;-split-package:=merge-first;version="3.2",

org.apache.commons.collections.iterators.*;-split-package:=merge-first;version="3.2",

org.jdom;-split-package:=merge-first;version="1.0",

org.jdom.*;-split-package:=merge-first;version="1.0",

org.jdom.input.*;-split-package:=merge-first;version="1.0",

org.jdom.output.*;-split-package:=merge-first;version="1.0",

org.apache.xerces.parsers.*;-split-package:=merge-first,

com.gestalt.soakit.core.*;-split-package;=merge-first,
                            <!--
                            javax.*;-split-package:=merge-first,
                            javax.jws.*;-split-package:=merge-first,
                            javax.xml.bind;-split-package:=merge-first,
                            javax.annotation;-split-package:=merge-first,
                            javax.xml.soap;-split-package:=merge-first,
                            javax.xml.stream;-split-package:=merge-first,
                            javax.activation;-split-package:=merge-first,
                            -->
                        </Export-Package>
          </instructions>
        </configuration>
      </plugin>
            <!--
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>

<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
                    <wtpmanifest>true</wtpmanifest>
                    <wtpapplicationxml>true</wtpapplicationxml>
                    <wtpversion>2.0</wtpversion>

<manifest>${basedir}/src/main/resources/META-INF/MANIFEST.MF</manifest>
                </configuration>
      </plugin>
            -->
    </plugins>
    <extensions>
    </extensions>
  </build>
</project>





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to