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

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

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.
ChitraMadan
ChitraMadanAccepted solution
New Participant
Jul 21, 2020 4:49 PM UTC

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
ChitraMadanAccepted solution
New Participant
Jul 21, 2020 4:49 PM UTC

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>
Translate