Rakesh
Rakesh

Reputation: 4334

Deploy 3rd party OSGI bundle through maven

I am working on developing osgi bundles and deploying it to adobe AEM.

I have two projects, both are OSGI bundles

  1. Main project
  2. toolkit project

I have added the toolkit project as a maven dependency in the main project pom and here is what I am trying to achieve:

When I deploy the main project, the bundle is deployed to AEM using the maven plugin, I want to deploy the dependency bundle (toolkit) also when the main project is deployed.

Is there a way to do this?

Thanks!

Upvotes: 2

Views: 861

Answers (1)

anotherdave
anotherdave

Reputation: 6744

Any OSGi bundle that's stored under /apps/[your-project]/install will get automatically deployed to AEM.

There are a number of Maven plugins that you could use within a CRX package to copy a dependency across into it at build time.

One example is Adobe's own content-package-maven-plugin. To copy across a JAR into a content bundle, use the following syntax in your POM from the AEM docs:

<plugin>
    <groupId>com.day.jcr.vault</groupId>
    <artifactId>content-package-maven-plugin</artifactId>
    <version>0.0.24</version>
    <extensions>true</extensions>
    <configuration>
        <filters>
            <filter>
                <root>/apps/myapp</root>
            </filter>
         </filters>
         <embeddeds>
            <embedded>
                <groupId>[toolkit-groupID]</groupId>
                <artifactId>[toolkit-artifactID]</artifactId>
                <target>/apps/[your-project]/install</target>
             </embedded>
         </embeddeds>
     </configuration>
</plugin> 

(The JAR itself also needs to be listed as a dependency on this project, as normal)

Upvotes: 2

Related Questions