Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7575

Define common instructions for bnd-maven-plugin

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Parent 33
    • Parent 34
    • General
    • None

    Description

      Once https://github.com/bndtools/bnd/issues/2265 is fixed and released in bnd-maven-plugin 4.0 we should upgrade to that version and make sure to define all the instructions common to all Sling bundles in the parameter bnd of the parent. Those instructions should include

      1. Bundle-Category: sling
      2. Bundle-Description: ${project.description}
      3. Bundle-DocURL: https://sling.apache.org|https://sling.apache.org/
      4. Bundle-License: Apache License, Version 2.0
      5. Bundle-Vendor: The Apache Software Foundation
      6. -exportcontents: ${removeall;${packages;VERSIONED};${packages;CONDITIONAL}}, this is to by default export all versioned packages, except for the ones which are conditionally included, compare with https://github.com/bndtools/bnd/issues/2131
      7. -snapshot: ${tstamp;yyyyMMddHHmmssSSS} (compare with https://www.mail-archive.com/dev@sling.apache.org/msg76177.html)

      Attachments

        Activity

          olli Oliver Lietz added a comment -

          kwin, I can't remember why I added the baseline instruction in the first place and after some testing "everything" seems to work – so I will remove baseline from our bnd files.

          olli Oliver Lietz added a comment - kwin , I can't remember why I added the baseline instruction in the first place and after some testing "everything" seems to work – so I will remove baseline from our bnd files.

          The baseline instruction is completely disregarded by the according maven plugin (https://github.com/bndtools/bnd/issues/2403).

          kwin Konrad Windszus added a comment - The baseline instruction is completely disregarded by the according maven plugin ( https://github.com/bndtools/bnd/issues/2403 ).
          olli Oliver Lietz added a comment -

          kwin, also the baseline instruction is missing. We have done baselining for all bundles in the past. What's the intention?

          olli Oliver Lietz added a comment - kwin , also the baseline instruction is missing. We have done baselining for all bundles in the past. What's the intention?
          olli Oliver Lietz added a comment -

          Ok, I will keep -removeheaders in the local instructions until there is consensus.

          olli Oliver Lietz added a comment - Ok, I will keep -removeheaders in the local instructions until there is consensus.

          Obviously bnd developers think differently. I would suggest starting a discussion about the automatically added Private-Packages header on their mailing list.

          kwin Konrad Windszus added a comment - Obviously bnd developers think differently. I would suggest starting a discussion about the automatically added Private-Packages header on their mailing list.
          cziegeler Carsten Ziegeler added a comment - - edited

          Why do we add (or not remove) entries to the manifest which have zero meaning?
          Private-Package is not an official header, adding it to the manifest make it look like it is. I see no point in having it there. Similar with the other headers

          cziegeler Carsten Ziegeler added a comment - - edited Why do we add (or not remove) entries to the manifest which have zero meaning? Private-Package is not an official header, adding it to the manifest make it look like it is. I see no point in having it there. Similar with the other headers
          kwin Konrad Windszus added a comment - - edited

          I think that bnd will always add packages within the bundle to either Export-Package or Private-Package, so that all packages within the bundle are listed in either of those two headers. Although not that useful for other bundles, I think the Private-Package does not do any harm. Why do you want to remove non-exported packages from the manifest?

          kwin Konrad Windszus added a comment - - edited I think that bnd will always add packages within the bundle to either Export-Package or Private-Package , so that all packages within the bundle are listed in either of those two headers. Although not that useful for other bundles, I think the Private-Package does not do any harm. Why do you want to remove non-exported packages from the manifest?
          olli Oliver Lietz added a comment -

          kwin, I have to investigate but I guess it's because of internal in the package name and -includeresource instruction for LuceneIndexHelper.

          olli Oliver Lietz added a comment - kwin , I have to investigate but I guess it's because of internal in the package name and -includeresource instruction for LuceneIndexHelper .

          olli Do you have some reference by which instructions those headers are being generated. At least Embed-Dependency and Embed-Transitive are not at all within bnd (only maven-bundle-plugin). Both Include-Resource and Private-Package are documented in https://bnd.bndtools.org/chapters/800-headers.html but I am not sure who adds those in the first place for JCR Oak Server (https://github.com/apache/sling-org-apache-sling-jcr-oak-server/blob/master/bnd.bnd).

          kwin Konrad Windszus added a comment - olli Do you have some reference by which instructions those headers are being generated. At least Embed-Dependency and Embed-Transitive are not at all within bnd (only maven-bundle-plugin). Both Include-Resource and Private-Package are documented in https://bnd.bndtools.org/chapters/800-headers.html but I am not sure who adds those in the first place for JCR Oak Server ( https://github.com/apache/sling-org-apache-sling-jcr-oak-server/blob/master/bnd.bnd ).
          olli Oliver Lietz added a comment -

          AFAIK all those headers are only used in the context of the maven-bundle-plugin. They were never interpreted by bnd in any way, and should therefore not be used with the bnd-maven-plugin.

          First two are from maven-bundle-plugin, last two are from bnd: https://bnd.bndtools.org/chapters/800-headers.html Right?

          So this should be fine:

          -removeheaders:\
            Include-Resource,\
            Private-Package
          
          olli Oliver Lietz added a comment - AFAIK all those headers are only used in the context of the maven-bundle-plugin. They were never interpreted by bnd in any way, and should therefore not be used with the bnd-maven-plugin. First two are from maven-bundle-plugin , last two are from bnd: https://bnd.bndtools.org/chapters/800-headers.html Right? So this should be fine: -removeheaders:\ Include-Resource,\ Private-Package
          olli Oliver Lietz added a comment -

          kwin, this instruction removes (in my opinion) unnecessary data from MANIFEST.MF which is added by bnd, e.g. JCR Oak Server bundle without -removeheaders contains:

          Private-Package: org.apache.jackrabbit.oak.plugins.index.lucene.util,o
           rg.apache.sling.jcr.oak.server.internal
          
          olli Oliver Lietz added a comment - kwin , this instruction removes (in my opinion) unnecessary data from MANIFEST.MF which is added by bnd, e.g. JCR Oak Server bundle without -removeheaders contains: Private-Package: org.apache.jackrabbit.oak.plugins.index.lucene.util,o rg.apache.sling.jcr.oak.server.internal
          kwin Konrad Windszus added a comment - - edited

          olli Why is that instruction necessary? Who adds those headers in the first place? AFAIK all those headers are only used in the context of the maven-bundle-plugin. They were never interpreted by bnd in any way, and should therefore not be used with the bnd-maven-plugin.

          kwin Konrad Windszus added a comment - - edited olli Why is that instruction necessary? Who adds those headers in the first place? AFAIK all those headers are only used in the context of the maven-bundle-plugin. They were never interpreted by bnd in any way, and should therefore not be used with the bnd-maven-plugin.
          olli Oliver Lietz added a comment -

          kwin, did you leave out -removeheaders on purpose?

          -removeheaders:\
            Embed-Dependency,\
            Embed-Transitive,\
            Include-Resource,\
            Private-Package
          
          olli Oliver Lietz added a comment - kwin , did you leave out -removeheaders on purpose? -removeheaders:\ Embed-Dependency,\ Embed-Transitive,\ Include-Resource,\ Private-Package
          kwin Konrad Windszus added a comment - Fixed in https://github.com/apache/sling-parent/commit/9bb75436e64596b05f019e4359a7bbbd5977b448 .

          Due to the limitation, that the removeall macro currenty doesn't support empty lists (https://groups.google.com/d/msg/bndtools-users/d8K2FTzJdeQ/JeVbVvncAAAJ) instruction 6 from above cannot currently be added. Instead the simpler version -exportcontents: ${packages;VERSIONED} is being used.

          kwin Konrad Windszus added a comment - Due to the limitation, that the removeall macro currenty doesn't support empty lists ( https://groups.google.com/d/msg/bndtools-users/d8K2FTzJdeQ/JeVbVvncAAAJ ) instruction 6 from above cannot currently be added. Instead the simpler version -exportcontents: ${packages;VERSIONED } is being used.

          People

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

            Dates

              Created:
              Updated:
              Resolved: