Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[FIXED JENKINS-30735] Expand environment variabes in file pattern.
  • Loading branch information
uhafner committed May 25, 2016
1 parent 3c764ce commit 0c7880bbe9c069bd98468f930ddddbb10c20987b
Showing with 5 additions and 3 deletions.
  1. +1 −1 plugin/findbugs.iml
  2. +1 −1 plugin/pom.xml
  3. +3 −1 plugin/src/main/java/hudson/plugins/findbugs/FindBugsPublisher.java
@@ -21,7 +21,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.jvnet.hudson.plugins:analysis-core:1.75" level="project" />
<orderEntry type="module" module-name="analysis-core" />
<orderEntry type="library" name="Maven: de.java2html:java2html:5.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.2" level="project" />
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
@@ -46,7 +46,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.75</version>
<version>1.77-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
@@ -16,6 +16,7 @@
import hudson.model.AbstractProject;
import hudson.model.Run;

import hudson.model.TaskListener;
import hudson.plugins.analysis.core.FilesParser;
import hudson.plugins.analysis.core.HealthAwarePublisher;
import hudson.plugins.analysis.core.ParserResult;
@@ -145,7 +146,8 @@ public BuildResult perform(final Run<?, ?> build, final FilePath workspace, fina

boolean isMavenBuild = isMavenBuild(build);
String defaultPattern = isMavenBuild ? MAVEN_DEFAULT_PATTERN : ANT_DEFAULT_PATTERN;
FilesParser collector = new FilesParser(PLUGIN_NAME, StringUtils.defaultIfEmpty(getPattern(), defaultPattern),
FilesParser collector = new FilesParser(PLUGIN_NAME,
StringUtils.defaultIfEmpty(expandFilePattern(getPattern(), build.getEnvironment(TaskListener.NULL)), defaultPattern),
new FindBugsParser(isRankActivated, getExcludePattern(), getIncludePattern()), shouldDetectModules(), isMavenBuild);

ParserResult project = workspace.act(collector);

4 comments on commit 0c7880b

@khanali21
Copy link

@khanali21 khanali21 commented on 0c7880b May 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for posting this question here. But I hope it turns out to be relevant. There are two questions:

  1. Apparently this plugin expects the "Sample Legacy XML Report" as described here http://gleclaire.github.io/findbugs-maven-plugin/examples/findbugsXml.xml,
    I have been trying to use it with maven findbugs:check goal, but the xml report generated is in new format as given described here http://gleclaire.github.io/findbugs-maven-plugin/examples/findbugs.xml.
    I am not clear if I am missing something here.
  2. I am intending to create a pull request for the second format. But not sure if there is any existing release plan for that and the above commit would be included in the release 4.65?
    thank in advance for any help.
    best
    Ali

@uhafner
Copy link
Member Author

@uhafner uhafner commented on 0c7880b May 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to start the goal findbugs:findbugs. Then the correct report is created. There is no need to change the input format.

@khanali21
Copy link

@khanali21 khanali21 commented on 0c7880b Jun 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks uhafner, got it.

@rohatgig
Copy link

@rohatgig rohatgig commented on 0c7880b Aug 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi;
seem it didnt find the method.
expandFilePattern @ line150 in FindBugPublisher file.

Can you please update the same.?

Please sign in to comment.