Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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>