AEM 6.5 : how to make core service custom package available in export | Community
Skip to main content
amitcsknit
Level 2
July 21, 2020
Solved

AEM 6.5 : how to make core service custom package available in export

  • July 21, 2020
  • 1 reply
  • 1429 views

in aem core my service package is not coming into export inside manifest & so not able to use in my jsp page in component.

How to include my service package of core bundle into export when it see it inside bundle in felix console.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ChitraMadan

Hi @amitcsknit,

 

You need to embedd your core package in your main application package, which will include your services package too.

And define core package as dependency.

 

<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<name>sampleapp.ui.apps</name>
<thumbnailImage>src/main/content/META-INF/vault/definition/thumbnail.png</thumbnailImage>
<embeddeds>
<embedded>
<groupId>co.sample.app</groupId>
<artifactId>co.sampleapp.core</artifactId>
<target>/apps/sampleapp/install</target>
</embedded>
</embeddeds>
</configuration>
</plugin>

<dependencies>
<dependency>
<groupId>co.sampleapp</groupId>
<artifactId>co.sampleapp.core</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

And then in your core package pom, make sure you have this configuration

 

<configuration>
<exportScr>true</exportScr>
<instructions>
<Import-Package>javax.inject;version=0.0.0,*</Import-Package>
<Export-Package>co.sampleapp.core.*;version="${project.version}"</Export-Package>
<Sling-Model-Packages>
co.sampleapp.core
</Sling-Model-Packages>
<_dsannotations>*</_dsannotations>
<_metatypeannotations>*</_metatypeannotations>
</instructions>
</configuration>

1 reply

ChitraMadan
Community Advisor
ChitraMadanCommunity AdvisorAccepted solution
Community Advisor
July 21, 2020

Hi @amitcsknit,

 

You need to embedd your core package in your main application package, which will include your services package too.

And define core package as dependency.

 

<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<name>sampleapp.ui.apps</name>
<thumbnailImage>src/main/content/META-INF/vault/definition/thumbnail.png</thumbnailImage>
<embeddeds>
<embedded>
<groupId>co.sample.app</groupId>
<artifactId>co.sampleapp.core</artifactId>
<target>/apps/sampleapp/install</target>
</embedded>
</embeddeds>
</configuration>
</plugin>

<dependencies>
<dependency>
<groupId>co.sampleapp</groupId>
<artifactId>co.sampleapp.core</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

And then in your core package pom, make sure you have this configuration

 

<configuration>
<exportScr>true</exportScr>
<instructions>
<Import-Package>javax.inject;version=0.0.0,*</Import-Package>
<Export-Package>co.sampleapp.core.*;version="${project.version}"</Export-Package>
<Sling-Model-Packages>
co.sampleapp.core
</Sling-Model-Packages>
<_dsannotations>*</_dsannotations>
<_metatypeannotations>*</_metatypeannotations>
</instructions>
</configuration>