Expand my Community achievements bar.

SOLVED

AEM maven build core bundle size issue

Avatar

Level 2

I have 2 AEM projects Project A and Project B.

I have added a dependency of Project A into Project B pom files. But while doing so I observe that the bundle size of Project B increases. I see that the jar of Project A is being embedded into Project B bundle. Could you guys please suggest?

Project A and B, both are deployed in the same AEM environment.

 

Parent POM of Project B with dependency of Project A:

<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>project-a-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

 

Core POM of Project B with dependencies of Project A:

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<!-- <Embed-Dependency> artifactId1, artifactId2;inline=true </Embed-Dependency> -->
<Import-Package>
!com.ibm.*,
!com.sun.*,
!sun.*,
!javax.jmdns.*,
!javax.jms.*,
!jline.*,
!org.jboss.netty.*,
!org.relaxng.datatype.*,
com.project.a.service,
com.project.a.model,
*
</Import-Package>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Directory>OSGI-INF/lib</Embed-Directory>
<Embed-Transitive>false</Embed-Transitive>
</instructions>
</configuration>
</plugin>

..

..

..

<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>project-a-core</artifactId>
</dependency>

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Typically you deploy content packages (zip files) to AEM, which contain these bundles. Normally a project produces a single content package, which can contain out of multiple nested content packages (depending on the version of the archetype you are using).

 

Now you can drill into project B and check where the project A's JAR is embedded. Then check the pom.xml file of the corresponding maven project for the content-package-maven-plugin or the filevault-maven-plugin and check it's configuration if it embeeds the A.jar.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Typically you deploy content packages (zip files) to AEM, which contain these bundles. Normally a project produces a single content package, which can contain out of multiple nested content packages (depending on the version of the archetype you are using).

 

Now you can drill into project B and check where the project A's JAR is embedded. Then check the pom.xml file of the corresponding maven project for the content-package-maven-plugin or the filevault-maven-plugin and check it's configuration if it embeeds the A.jar.