Export packages are missing in Manifest.MF Header | Community
Skip to main content
Level 3
March 2, 2021
Solved

Export packages are missing in Manifest.MF Header

  • March 2, 2021
  • 2 replies
  • 6457 views

Hi Everyone - I am using maven-bundle-plugin artifact in the core module. The issue I am facing is sling model not available, I found that Export Package header in the bundle MANIFEST.MF section is empty which causes the issues with the sling models.

I have also tried with "bnd-maven-plugin" artifactId and removed the VERSIONED filter from -exportcontents but it is still not generating. I have already tried with updating the Manifest.MF manually and it worked, so the issue is only related to Export Package header. Can someone suggest on this issue?

 

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.1.0</version>
<inherited>true</inherited>
<configuration>
<instructions>
<!--<Embed-Dependency>org.apache.servicemix.bundles.aws-java-sdk, netty-all</Embed-Dependency>
--><!-- Import any version of javax.inject, to allow running on multiple
versions of AEM -->
<Import-Package>javax.inject;version=0.0.0,*</Import-Package>
<Sling-Model-Packages>
com.test.aem.abc.core.xyz.impl.models
</Sling-Model-Packages>
</instructions>
</configuration>
</plugin>

@Arun_Patidar

 

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 Vijayalakshmi_S

Hi @s1101v,

Can you share the latest core/pom.xml(in particular, <build> tag details) and package structure of Java classes. 

 

2 replies

Anudeep_Garnepudi
Community Advisor
Community Advisor
March 3, 2021

@s1101v 

Check you package is under Private-Package, in bundle manifest. If so add package info(package-info.java) to your package and see.

AG
s1101vAuthor
Level 3
March 3, 2021
@anudeep_garnepudi - I have already added the package-info in my package, I still don't see "Private-Package" section in the bundle. In order to make the model available, the package should be listed in the Private-Package section?
Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
March 4, 2021

Hi @s1101v,

Can you share the latest core/pom.xml(in particular, <build> tag details) and package structure of Java classes. 

 

s1101vAuthor
Level 3
March 4, 2021
@vijayalakshmi_s - PFB Package Structure: com.company.aem.xyz.core.models -> (Models & Interface) <build> <plugins> <plugin> <groupId>org.apache.sling</groupId> <artifactId>sling-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Export-Package> com.company.aem.xyz.core.* </Export-Package> <Bundle-SymbolicName>com.company.aem.xyz.core</Bundle-SymbolicName> <Import-Package>javax.inject;version=0.0.0,*</Import-Package> <Sling-Model-Packages> com.company.aem.xyz.core.models </Sling-Model-Packages> </instructions> </configuration> </plugin> <build>