Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5163

Suppress empty classpath warnings from bnd when creating a fragment with a manifest only

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • maven-bundle-plugin-3.0.1
    • None
    • Maven Bundle Plugin
    • None

    Description

      Currently bnd emits the following warnings when building a fragment with the maven-bundle-plugin which does not contain any classes (which is totally valid)

      WARNING] Bundle somegroup:system-fragment-xml-api:bundle:1.0-SNAPSHOT : Classpath is empty. Private-Package (-privatepackage) and Export-Package can only expand from the classpath when there is one
      [WARNING] Bundle somegroup:system-fragment-xml-api:bundle:1.0-SNAPSHOT : Unused Private-Package instructions, no such package(s) on the class path: [!*]
      [WARNING] Bundle somegroup:system-fragment-xml-api:bundle:1.0-SNAPSHOT : The JAR is empty: The instructions for the JAR named somegroup.system-fragment-xml-api did not cause any content to be included, this is likely wrong
      

      Attached is a demo pom.xml.

      Just setting the instruction -resourceonly to true in that case should be enough to suppress those warning (compare with https://github.com/bndtools/bnd/issues/1287).

      Maven-Bundle-Plugin should check if the header FragmentHost host is set and the classpath is empty. IFF that is the case it should call bnd with resourceonly:true.

      Attachments

        1. pom.xml
          1 kB
          Konrad Windszus

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: