Embed Third party dependency using bnd-maven-plugin

This post explains the use of bnd-maven-plugin to embed third party dependency 

bnd-maven-plugin

Two main instructions of bnd-maven-plugin that serves the purpose are detailed below. 

  • -conditionalpackage 
    • pick packages from respective library and copy them in the bundle. Any dependencies of those copied packages will also be copied if they match the selectors.
    • This means we need to explicitly list all the Java package names of desired dependency as part of this instruction (including its transitive dependencies)
    • More about conditionalpackage instruction from official docs - https://bnd.bndtools.org/instructions/conditionalpackage.html
  • -includeresource 
    • For including resource inline
      • -includeresource: @artifactId-version.jar!/*
    • For embedding as a jar with an entry in bundle class path
      • -includeresource: artifactId-version.jar;lib:=true
    • For several other possible combinations for including the resource, please check - https://bnd.bndtools.org/instructions/includeresource.html
With complete understanding on these two instructions from official docs + based on how we would like the dependency to be included, we can use any one of the instruction with its respective options accordingly. 

Sample plugin entry for the dependency jackson-dataformat-csv (Supports reading and writing CSV)
where ${jackson-dataformat-csv.version} in the instruction resolves to a maven property holding the artifact version (2.9.5) as defined in parent pom.xml.
  • conditionalpackage
  • includeresource inline
  • includeresource embed (as a jar with class path entry)

Other blog posts for embedding third party dependency using maven-bundle-plugin

Comments

  1. Description: Experience a realm of unmatched comfort and luxury with the best rooms in Nagercoil  at Hotel Vijayetha. Immerse yourself in a world where modern elegance meets warm hospitality, creating a haven for discerning travelers seeking the epitome of accommodation.

    Our best rooms are thoughtfully designed to provide a tranquil retreat for both business and leisure guests. From intimate singles to spacious suites, each room is adorned with tasteful decor, contemporary furnishings, and premium amenities to ensure a restful sanctuary.

    Indulge in a culinary journey at our on-site restaurant, offering exquisite flavors and culinary delights. The central location of Hotel Vijayetha provides easy access to local attractions, business centers, and transportation hubs, making it the ideal choice for those seeking convenience and style.

    Unwind in the plush surroundings, relish the warmth of attentive staff, and enjoy the convenience of modern amenities such as high-speed Wi-Fi and well-appointed bathrooms. Hotel Vijayetha's commitment to excellence guarantees that your stay in Nagercoil is marked by comfort, style, and an unparalleled level of service.

    Book the best rooms in Nagercoil at Hotel Vijayetha and elevate your travel experience to new heights. Whether you're on a business trip or exploring the city's cultural gems, our best rooms redefine the meaning of luxury and ensure a memorable stay..visit us on https://www.hotelvijayetha.com/our-rooms/.!!!

    ReplyDelete

Post a Comment

Popular posts from this blog

Embedding Third party dependency/OSGi bundle in AEM application hosted in AEMasCS

OSGI Factory Configuration implementation

Creation of Template Types for Editable templates