Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Problem with including jars using <Embed-Dependency> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with including jars using <Embed-Dependency>

    I'm trying to embed third party libs and application jar in a OSGI bundle.I read the felix maven plugin document and tried using Embed-Dependency. But it doesn't seem to have any effect. Here's my pom

    Code:
    <dependencies>
            <dependency>
                <groupId>com.test</groupId>
                <artifactId>taxonomymessagebundle</artifactId>
                <version>1.0</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.4</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.0.1</version>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Export-Package>com.test.taxonomy.dao.*;version=1.0.0</Export-Package>
                            <Import-Package>*</Import-Package>
                        </instructions>
                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    I'm using mvn clean install to build the bundle. After the install, I took a look into the manifest file, it doesn't show any Bundle-Classpath or Embed information. Looks like it completely ignored the instruction. Also, the two dependent jars were not embedded as well in the bundle.

    Here's the generated manifest:

    Code:
    Manifest-Version: 1.0
    Export-Package: com.test.taxonomy.dao;uses:="com.autodesk.taxonomy";version="1.0.0"
    Bundle-Version: 1.0.0
    Build-Jdk: 1.6.0_21
    Built-By: bandops
    Tool: Bnd-0.0.357
    Bnd-LastModified: 1307492329392
    Bundle-Name: Taxonomy Dao Bundle
    Bundle-ManifestVersion: 2
    Created-By: Apache Maven Bundle Plugin
    Import-Package: com.test.taxonomy.dao;version="1.0",com.autodesk.test.message
    Bundle-SymbolicName: com.test.taxonomy.daobundle
    Any pointers will be appreciated.

    -Thanks

  • #2
    I found the issue,the <Embed-Dependency> was outside the scope of <Instructions>.

    But,using <Embed-Dependency> doesn't seem to have resolved the issue. While doing a maven install, it complained about not resolving dependencies in import-package. And the list seemed to be pretty comprehensive which included the transitive dependent packages as well. I'm struggling to understand the best practice of using non-OSGI compliant jars in an OSGI environment. Can someone share their experience?

    Comment


    • #3
      Show your final manifest file and maven message about "not resolving dependencies in import-package"

      Comment

      Working...
      X