You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Trevor Gelowsky <ge...@gmail.com> on 2008/05/13 19:17:18 UTC

Maven-Bundle-Plugin, library plugins, and eclipse/PDE

Hi,

This question has probably been asked a thousand times in a thousand 
variations, but I was wondering how I could use maven-bundle-plugin to 
create an eclipse library plug-ins in the case where I'm mainly 
importing external jarfiles and resources and aggregating them into a 
single package that can then be used as a resource for all the other 
plug-ins in the product.

Now it compiles and creates the manifest/library successfully, but 
eclipse refuses to resolve the plug-in.

The main error I get in eclipse from the following POM file (in about a 
thousand variations) is "No available bundle exports package 'ch.ethz.ssh2'"


<?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">


    <!-- Project Properties -->
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.orgz</groupId>
    <artifactId>com.orgz.library</artifactId>
    <version>0.0.1</version>
    <description>Library Plug-in</description>
    <name>com.orgz.library</name>
    <packaging>bundle</packaging>


    <!-- Orginization Information -->
    <organization>
        <!-- Orginization Name for the POM file.
            Automatically sets the "Provider" Portion of the plug-in 
manifest -->
        <name>XYZ</name>
        <!-- Orginization URL for the POM file.
            Automatically sets the Documentation URL Portion of the 
plug-in manifest -->
        <url>XYZ</url>
    </organization>


    <!-- Dependencies -->
    <dependencies>

        <!-- Plug-In Dependencies -->

        <dependency>
            <groupId>org.eclipse.core</groupId>
            <artifactId>runtime</artifactId>
            <version>[3.3.0, 4.0.0)</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>[1.0.4,)</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.6.5</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <!-- Third-party Libraries -->
        <dependency>
            <groupId>xmlbeans</groupId>
            <artifactId>xbean</artifactId>
            <version>1.0.4</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>jboss</groupId>
            <artifactId>jbossall-client</artifactId>
            <version>3.2.3</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>1.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.6.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>1.4.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>1.4.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>snmp4j</groupId>
            <artifactId>snmp4j</artifactId>
            <version>1.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>sftp</groupId>
            <artifactId>sftp</artifactId>
            <version>1.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.jamonapi</groupId>
            <artifactId>jamon</artifactId>
            <version>2.5</version>
        </dependency>
    </dependencies>


    <!-- Build Plugin -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.4.0</version>
                <extensions>true</extensions>

                <!--
                    the following instructions build a simple set of 
public/private classes into an OSGi bundle
                -->
                <configuration>
                    <manifestLocation>META-INF</manifestLocation>
                    <instructions>

                        <_exportcontents>*</_exportcontents>

                        <!-- Export-Package>
                            
*;version:=${pom.version};-split-package:=merge-first;-noimport:=true
                            </Export-Package -->

                        <Embed-Dependency>
                            *;scope=compile|runtime;inline=false
                        </Embed-Dependency>

                        <Embed-StripGroup>true</Embed-StripGroup>

                        <Embed-Transitive>false</Embed-Transitive>


                        <!-- These just get made into the corresponding 
manifest entries -->
                        <Bundle-SymbolicName>
                            com.orgz.library
                        </Bundle-SymbolicName>
                        <Require-Bundle>
                            org.apache.commons.logging,
                            org.eclipse.core.runtime
                        </Require-Bundle>
                        <Bundle-Version>${pom.version}</Bundle-Version>
                        <Bundle-RequiredExecutionEnvironment>
                            J2SE-1.5
                        </Bundle-RequiredExecutionEnvironment>
                        <Bundle-ActivationPolicy>
                            lazy
                        </Bundle-ActivationPolicy>
                        <Eclipse-ExtensibleAPI>
                            true
                        </Eclipse-ExtensibleAPI>
                        <Eclipse-BuddyPolicy>
                            registered
                        </Eclipse-BuddyPolicy>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


Any help would be appreciated.

~T

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org