how to migrate maven-bundle-plugin to bnd-maven-plugin for AEMaaCS???? | Community
Skip to main content
Level 4
December 1, 2023
Solved

how to migrate maven-bundle-plugin to bnd-maven-plugin for AEMaaCS????

  • December 1, 2023
  • 3 replies
  • 2528 views
Existing cor/pom.xml  

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>!org.xhtmlrenderer.pdf.*;!org.apache.jcp.xml.dsig.internal.dom.*;!org.apache.xml.security.utils.*;!com.itextpdf.*;!org.bouncycastle.*;!twitter4j.*;!com.lowagie.*;!com.apple.mrj.*;!com.itextpdf.*;javax.inject;version=0.0.0,*</Import-Package>
<Sling-Model-Packages>
do.max.core.aem
</Sling-Model-Packages>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>*;groupId=com.maxmind.geoip2|com.itextpdf|com.lowagie|com.fasterxml.jackson.core|com.maxmind.db|org.xhtmlrenderer|com.atlassian.commonmark;scope=compile|runtime;type=!pom;
inline=false,jsoup</Embed-Dependency>
</instructions>
</configuration>
</plugin>

Need to migrate to bnd-maven-plugin(biz.aQute.bnd)

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<executions>
<execution>
<id>bnd-process</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<bnd><![CDATA[
Export-Package: do.max.core.aem.*,\
Import-Package: javax.annotation;version=0.0.0,*
Sling-Model-Packages: do.max.core.aem
Bundle-DocURL:
-plugin org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin
-plugin org.apache.sling.bnd.models.ModelsScannerPlugin
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>

I have tried the solution from all the old thread still not resolved yet.

could you please guide anyone as i'm facing issue from long time????

 

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 arunpatidar

Hi @karthickve 
You can check sample plugin here, let me know if anything specific is not working for you

https://github.com/arunpatidar02/aemaacs-aemlab/blob/f96ce5316dfa4798c72d2e87d3a0b41fc49791a4/pom.xml#L138 

 

 

Bnd-maven-plugin : https://github.com/bndtools/bnd/blob/master/maven-plugins/bnd-maven-plugin/README.md 

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
December 1, 2023
Arun Patidar
Level 4
December 12, 2023

@arunpatidar , Thanks for input.

aanchal-sikka
Community Advisor
Community Advisor
December 1, 2023

Hello @karthickve 

 

Please refer to this PR of ACS commons, where a similar transition was done

https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/2761

 

It will help you understand the changes needed.

 

Another Article is: https://wcm-io.atlassian.net/wiki/spaces/WCMIO/pages/1267040260/How+to+switch+from+maven-bundle-plugin+to+bnd-maven-plugin

 

Hope it helps !

Aanchal Sikka
Level 4
December 12, 2023

@aanchal-sikka , Thanks for input, I learnt it.

kautuk_sahni
Community Manager
Community Manager
December 4, 2023

@karthickve Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
Level 4
December 12, 2023

@kautuk_sahni , Yes, both of them suggestion is useful for me.