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

Improve moodule detection for projects that contain both ant build.xml files and maven pom.xml files

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • warnings-plugin
    • None
    • Platform: All, OS: All

    Description

      http://hudson.gotdns.com/wiki/display/JENKINS/Warnings+Plugin

      as well as screenshots in

      http://hudson.gotdns.com/wiki/display/JENKINS/Static+Code+Analysis+Plug-ins#StaticCodeAnalysisPlug-ins-overview

      imply that I should be seeing a "Modules" tab in the Hudson results in the above
      URL. But there is none; the row of tabs starts with "Packages".

      The large Ant-based build traverses hundreds of distinct modules, each with
      their own Ant build.xml with a configured project name, so I don't see why no
      module name would be calculated.

      Attachments

        Activity

          jglick Jesse Glick created issue -
          drulli Ulli Hafner added a comment -

          The computation is based on file name prefixes (warning file vs. found ant
          build.xml files., maybe that guessing does not work in your case...).

          drulli Ulli Hafner added a comment - The computation is based on file name prefixes (warning file vs. found ant build.xml files., maybe that guessing does not work in your case...).
          drulli Ulli Hafner added a comment -

          I just realized that this feature is not yet implemented for the warnings
          plug-in. I think that using a similar approach as in the tasks plugin will work.
          There I try to map absolute file names to a pom.xml or build.xml file that have
          the largest prefix in common.

          drulli Ulli Hafner added a comment - I just realized that this feature is not yet implemented for the warnings plug-in. I think that using a similar approach as in the tasks plugin will work. There I try to map absolute file names to a pom.xml or build.xml file that have the largest prefix in common.
          jglick Jesse Glick added a comment -

          I believe that approach would work. A typical warning line would be

          /hudson/workdir/jobs/test-compilation/workspace/visualweb.webui.themes/src/org/netbeans/modules/visualweb/webui/themes/ThemesFolderNode.java:201:
          warning: [unchecked] unchecked call to put(K,V) as a member of the raw type
          java.util.Map
          themesList.put(lib.getName(), lib);
          ^

          where
          /hudson/workdir/jobs/test-compilation/workspace/visualweb.webui.themes/build.xml
          contains a <project name='...' ...> root element (though just the relative dir
          path 'visualweb.webui.themes' would be fine as a module name too).

          jglick Jesse Glick added a comment - I believe that approach would work. A typical warning line would be /hudson/workdir/jobs/test-compilation/workspace/visualweb.webui.themes/src/org/netbeans/modules/visualweb/webui/themes/ThemesFolderNode.java:201: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Map themesList.put(lib.getName(), lib); ^ where /hudson/workdir/jobs/test-compilation/workspace/visualweb.webui.themes/build.xml contains a <project name='...' ...> root element (though just the relative dir path 'visualweb.webui.themes' would be fine as a module name too).
          drulli Ulli Hafner added a comment -

          Fixed in Trunk.

          drulli Ulli Hafner added a comment - Fixed in Trunk.
          drulli Ulli Hafner made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          jglick Jesse Glick added a comment -

          It is not working correctly for my project (same URL as before) using Warnings
          plugin 2.1 on Hudson 1.273: the handful of source code which happens to be
          inside a dir with a pom.xml is marked with the Maven module name, but the
          hundreds of Ant modules are listed only as "Default Module".

          I think ModuleDetector.createFilesToModuleMapping is incorrect in assuming that
          a workspace contains exclusively Maven modules or exclusively Ant modules. (If a
          single directory contains both build.xml and pom.xml, as is common, I would
          suggest giving the POM preference as it is likely to be a more accurate source
          of display name metadata.)

          jglick Jesse Glick added a comment - It is not working correctly for my project (same URL as before) using Warnings plugin 2.1 on Hudson 1.273: the handful of source code which happens to be inside a dir with a pom.xml is marked with the Maven module name, but the hundreds of Ant modules are listed only as "Default Module". I think ModuleDetector.createFilesToModuleMapping is incorrect in assuming that a workspace contains exclusively Maven modules or exclusively Ant modules. (If a single directory contains both build.xml and pom.xml, as is common, I would suggest giving the POM preference as it is likely to be a more accurate source of display name metadata.)
          jglick Jesse Glick made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          drulli Ulli Hafner made changes -
          Issue Type New Feature [ 2 ] Improvement [ 4 ]
          Priority Major [ 3 ] Minor [ 4 ]
          drulli Ulli Hafner made changes -
          Summary No "Modules" tab displayed Improve moodule detection for projects that contain both ant build.xml files and maven pom.xml files

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          .settings/org.eclipse.core.resources.prefs
          src/main/java/hudson/plugins/analysis/util/ModuleDetector.java
          src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java
          http://jenkins-ci.org/commit/analysis-core-plugin/0077608e2333ba247dfdcb34917673c470529b12
          Log:
          [FIXED JENKINS-2657] Let maven modules take precedence over ant modules.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: .settings/org.eclipse.core.resources.prefs src/main/java/hudson/plugins/analysis/util/ModuleDetector.java src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java http://jenkins-ci.org/commit/analysis-core-plugin/0077608e2333ba247dfdcb34917673c470529b12 Log: [FIXED JENKINS-2657] Let maven modules take precedence over ant modules.
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          dogfood dogfood added a comment -

          Integrated in plugins_analysis-core #166
          [FIXED JENKINS-2657] Let maven modules take precedence over ant modules.

          Ulli Hafner :
          Files :

          • .settings/org.eclipse.core.resources.prefs
          • src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java
          • src/main/java/hudson/plugins/analysis/util/ModuleDetector.java
          dogfood dogfood added a comment - Integrated in plugins_analysis-core #166 [FIXED JENKINS-2657] Let maven modules take precedence over ant modules. Ulli Hafner : Files : .settings/org.eclipse.core.resources.prefs src/test/java/hudson/plugins/analysis/util/ModuleDetectorTest.java src/main/java/hudson/plugins/analysis/util/ModuleDetector.java
          jglick Jesse Glick added a comment -

          Without having tried the new code yet, just a warning that the commit comment "Let maven modules take precedence over ant modules" does not address the primary bug, which was "createFilesToModuleMapping is incorrect in assuming that
          a workspace contains exclusively Maven modules or exclusively Ant modules". Perhaps that was fixed earlier, or as part of this patch, but if so the log did not mention it.

          jglick Jesse Glick added a comment - Without having tried the new code yet, just a warning that the commit comment "Let maven modules take precedence over ant modules" does not address the primary bug, which was "createFilesToModuleMapping is incorrect in assuming that a workspace contains exclusively Maven modules or exclusively Ant modules". Perhaps that was fixed earlier, or as part of this patch, but if so the log did not mention it.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 132730 ] JNJira + In-Review [ 186573 ]

          People

            drulli Ulli Hafner
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: