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

PMD plugin should use maven artifactId if project name is not set

      None of our POMs set the project name. This appears to prevent the PMD plugin from presenting the issues categorized by maven module (no "modules" tab).

      I tried setting <name>${project.artifactId}</name> in the parent POM, but this ended up being literally quoted.

      The findbugs plugin works as expected.

          [JENKINS-19904] PMD plugin should use maven artifactId if project name is not set

          Ulli Hafner added a comment -

          Is this in a maven or freestyle job? I thought that variables should be resolved in maven jobs.

          Ulli Hafner added a comment - Is this in a maven or freestyle job? I thought that variables should be resolved in maven jobs.

          Philip Aston added a comment -

          Its a maven job, with a multi-module project.

          Philip Aston added a comment - Its a maven job, with a multi-module project.

          Ulli Hafner added a comment - - edited

          When I do not set the name in the pom then the artifact ID is used. Is your name empty or just not set? Can you please attach the pmd-warnings.xml file that is stored by my plugin in the build folder? Or a small sample project that reproduces the bug?

          Ulli Hafner added a comment - - edited When I do not set the name in the pom then the artifact ID is used. Is your name empty or just not set? Can you please attach the pmd-warnings.xml file that is stored by my plugin in the build folder? Or a small sample project that reproduces the bug?

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/core/HealthAwareReporter.java
          http://jenkins-ci.org/commit/analysis-core-plugin/03d75c2c1f3cc26f67309b02191a782379d08873
          Log:
          [FIXED JENKINS-19904] If project name is empty use the artifact ID.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/core/HealthAwareReporter.java http://jenkins-ci.org/commit/analysis-core-plugin/03d75c2c1f3cc26f67309b02191a782379d08873 Log: [FIXED JENKINS-19904] If project name is empty use the artifact ID.

          Philip Aston added a comment - - edited

          The name is not set. I've tried setting it with no difference.

          But it looks like you found the problem anyway.

          Many thanks, I'll look forward to the next release.

          Philip Aston added a comment - - edited The name is not set. I've tried setting it with no difference. But it looks like you found the problem anyway. Many thanks, I'll look forward to the next release.

          Ulli Hafner added a comment -

          Actually I did not find the problem. I just added another improvement: if the name tag is present but empty, then the module name will be empty too. That was a guess about your problem but seems to be unrelated...

          Maybe you could attach the file? Then I can check what the value of the module tag is in your warnings.

          Ulli Hafner added a comment - Actually I did not find the problem. I just added another improvement: if the name tag is present but empty, then the module name will be empty too. That was a guess about your problem but seems to be unrelated... Maybe you could attach the file? Then I can check what the value of the module tag is in your warnings.

          Philip Aston added a comment -

          I'd have to produce a test case. (Its internal code, and there's about 80 pom files).

          Seeing no-one else is waiting for this, let me pick up the fix in your next release and I'll report back on whether it works.

          Philip Aston added a comment - I'd have to produce a test case. (Its internal code, and there's about 80 pom files). Seeing no-one else is waiting for this, let me pick up the fix in your next release and I'll report back on whether it works.

          Ulli Hafner added a comment -

          ok.

          Ulli Hafner added a comment - ok.

            drulli Ulli Hafner
            philipa Philip Aston
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: