Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 2

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.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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>

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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>