Naveen
Naveen

Reputation: 139

Adding Embeded-Dependency in maven

Actually when i build my project it deploys the bundle to the running OSGI console. Now the bundle is in installed state and shows an red alert that commons-net bundle can not be find.

One way of solving this is problem is to install the bundle to the running osgi framework itself explicitly.

Another way could be adding Embeded-Dependency to the maven. But this approach is not working. I added Embeded-Dependency to the instruction tag in maven-build-plugin. It didn't show any error.

Please let me know if any suggestions.

Upvotes: 1

Views: 559

Answers (1)

Balazs Zsoldos
Balazs Zsoldos

Reputation: 6046

Embeded-Dependency did not show any error as you can place anything into the instructions. If the key-value pair is not known it will be simply inserted into the MANIFEST.MF as it is. Try writing Embed-Dependency, that should make it work.

A good example could be the following (how we created hibernate bundle for ourselves):

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <instructions>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <_exportcontents>
                !org.hibernate.validator.*,
                org.hibernate.*;-noimport:=true,
            </_exportcontents>
            <Import-Package>
                javax.persistence*;version="1.1.0",
                javax.naming*,
                javax.sql,
                javax.transaction*;version="1.1.0",
                javax.xml.stream.*,
                javax.xml.*,
                org.slf4j,
                org.w3c.dom,
                org.xml.sax*,
                antlr.*,
                org.jboss.logging.*,
                org.dom4j*,
                *;resolution:=optional
            </Import-Package>
            <Embed-Dependency>
                groupId=org.hibernate;artifactId=hibernate-core,
                groupId=org.hibernate;artifactId=hibernate-entitymanager,
                groupId=org.hibernate.common;artifactId=hibernate-commons-annotations
            </Embed-Dependency>
        </instructions>
    </configuration>
</plugin>

Upvotes: 2

Related Questions