Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10681

Detect modules should support OSGi Bundles

    XMLWordPrintable

Details

    Description

      The "Detect modules" currently only support maven 'modules'. It would be nice if it also would support OSGi Bundles.
      An OSGi Bundle consists of a manifest files describing the bundle in the META-INF directory (see here for example http://www.javaworld.com/javaworld/jw-03-2008/jw-03-osgi1.html?page=2 a little down the page).
      If the warnings could be grouped based on these bundles it would be a great help.

      Attachments

        Activity

          laeubi Christoph Läubrich created issue -
          drulli Ulli Hafner added a comment -

          Don't you use ant or maven to build your OSGi bundles?

          drulli Ulli Hafner added a comment - Don't you use ant or maven to build your OSGi bundles?

          I use http://www.ant4eclipse.org/ to build the bundles which reads the eclipse project files so there is no need to create special ant-build files for each project/bundle.

          So the whole build is done by one antfile just iterating over all projects/bundles (which in fact is not part of the workspace but located in a seperate folder).

          laeubi Christoph Läubrich added a comment - I use http://www.ant4eclipse.org/ to build the bundles which reads the eclipse project files so there is no need to create special ant-build files for each project/bundle. So the whole build is done by one antfile just iterating over all projects/bundles (which in fact is not part of the workspace but located in a seperate folder).

          It would also be cool if it where possible then to sort either by Bundle Name (Bundle-Name) and Bundle author (Bundle-Vendor)!
          Since the vendor is in some Projects filled with responsible developer name, this would give a nice statistic warnings per developer, but that is just a thought I recently had

          laeubi Christoph Läubrich added a comment - It would also be cool if it where possible then to sort either by Bundle Name (Bundle-Name) and Bundle author (Bundle-Vendor)! Since the vendor is in some Projects filled with responsible developer name, this would give a nice statistic warnings per developer, but that is just a thought I recently had
          drulli Ulli Hafner added a comment -

          Hmm, that means the OSGi part should overwrite the ANT part, shouldn't it?

          drulli Ulli Hafner added a comment - Hmm, that means the OSGi part should overwrite the ANT part, shouldn't it?

          Yes, the ant part actually could be ignored at all.

          laeubi Christoph Läubrich added a comment - Yes, the ant part actually could be ignored at all.
          drulli Ulli Hafner added a comment - Interested in providing a patch? The following class needs to be changed: https://github.com/jenkinsci/analysis-core-plugin/blob/master/src/main/java/hudson/plugins/analysis/util/ModuleDetector.java
          drulli Ulli Hafner made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Minor [ 4 ]

          I'll give it a try, I'm I right that i just need to add to the map the full pathname for any file?
          For example if I hava a file /a/b/c.java that belongs to module X I put

          laeubi Christoph Läubrich added a comment - I'll give it a try, I'm I right that i just need to add to the map the full pathname for any file? For example if I hava a file /a/b/c.java that belongs to module X I put

          fileNameToModuleName.put("/a/b/c.java", "X");
          and I'm done? I'm not 100% sure how the exact format must be...

          (sorry browser send reply while i was typing...)

          laeubi Christoph Läubrich added a comment - fileNameToModuleName.put("/a/b/c.java", "X"); and I'm done? I'm not 100% sure how the exact format must be... (sorry browser send reply while i was typing...)
          drulli Ulli Hafner added a comment -

          No, the mapping contains just the root folders:

          /a/b/c/pom.xml ->

          put("/a/b/c", "module name");

          In your case:

          /a/b/bundle-root/META-INF/MANIFEST.MF ->

          put("/a/b/bundle-root", "module name");

          All Files that share the same prefix use the value of the map.

          drulli Ulli Hafner added a comment - No, the mapping contains just the root folders: /a/b/c/pom.xml -> put("/a/b/c", "module name"); In your case: /a/b/bundle-root/META-INF/MANIFEST.MF -> put("/a/b/bundle-root", "module name"); All Files that share the same prefix use the value of the map.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/util/ModuleDetector.java
          http://jenkins-ci.org/commit/analysis-core-plugin/9a77f974fe8ea4c6d86cc99fffb97390e6be8924
          Log:
          JENKINS-10681 Added support for OSGi modules when mapping warnings
          to modules. If a module is an OSGi bundle then the content of pom or
          build.xml will not be used.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/util/ModuleDetector.java http://jenkins-ci.org/commit/analysis-core-plugin/9a77f974fe8ea4c6d86cc99fffb97390e6be8924 Log: JENKINS-10681 Added support for OSGi modules when mapping warnings to modules. If a module is an OSGi bundle then the content of pom or build.xml will not be used.
          dogfood dogfood added a comment -
          dogfood dogfood added a comment - Integrated in plugins_analysis-core #159

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/util/ModuleDetector.java
          src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java
          src/test/resources/hudson/plugins/analysis/util/MANIFEST-NAME.MF
          src/test/resources/hudson/plugins/analysis/util/MANIFEST.MF
          src/test/resources/hudson/plugins/analysis/util/l10n.properties
          http://jenkins-ci.org/commit/analysis-core-plugin/5704f5571c662d874e710102634d14c21c888071
          Log:
          [FIXED JENKINS-10681] Added support for localized MANIFEST files.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/util/ModuleDetector.java src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java src/test/resources/hudson/plugins/analysis/util/MANIFEST-NAME.MF src/test/resources/hudson/plugins/analysis/util/MANIFEST.MF src/test/resources/hudson/plugins/analysis/util/l10n.properties http://jenkins-ci.org/commit/analysis-core-plugin/5704f5571c662d874e710102634d14c21c888071 Log: [FIXED JENKINS-10681] Added support for localized MANIFEST files.
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          dogfood dogfood added a comment -

          Integrated in plugins_analysis-core #161
          [FIXED JENKINS-10681] Added support for localized MANIFEST files.

          Ulli Hafner :
          Files :

          • src/test/resources/hudson/plugins/analysis/util/MANIFEST-NAME.MF
          • src/main/java/hudson/plugins/analysis/util/ModuleDetector.java
          • src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java
          • src/test/resources/hudson/plugins/analysis/util/l10n.properties
          • src/test/resources/hudson/plugins/analysis/util/MANIFEST.MF
          dogfood dogfood added a comment - Integrated in plugins_analysis-core #161 [FIXED JENKINS-10681] Added support for localized MANIFEST files. Ulli Hafner : Files : src/test/resources/hudson/plugins/analysis/util/MANIFEST-NAME.MF src/main/java/hudson/plugins/analysis/util/ModuleDetector.java src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java src/test/resources/hudson/plugins/analysis/util/l10n.properties src/test/resources/hudson/plugins/analysis/util/MANIFEST.MF
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 140875 ] JNJira + In-Review [ 189313 ]

          People

            drulli Ulli Hafner
            laeubi Christoph Läubrich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: