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

Avatar

Avatar
Boost 3
Level 1
amitcsknit
Level 1

Likes

3 likes

Total Posts

17 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Validate 1
Establish
Give Back 3
Give Back
View profile

Avatar
Boost 3
Level 1
amitcsknit
Level 1

Likes

3 likes

Total Posts

17 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Validate 1
Establish
Give Back 3
Give Back
View profile
amitcsknit
Level 1

21-07-2020

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.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
ChitraMadan
MVP

Likes

273 likes

Total Posts

165 posts

Correct reply

67 solutions
Top badges earned
Boost 250
Establish
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 250
MVP
ChitraMadan
MVP

Likes

273 likes

Total Posts

165 posts

Correct reply

67 solutions
Top badges earned
Boost 250
Establish
Ignite 1
Give Back 5
Give Back 3
View profile
ChitraMadan
MVP

21-07-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>

Answers (0)