Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-30735] Expand environment variabes in file pattern.
  • Loading branch information
uhafner committed May 25, 2016
1 parent 3c764ce commit 0c7880b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin/findbugs.iml
Expand Up @@ -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" />
Expand Down
2 changes: 1 addition & 1 deletion plugin/pom.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

4 comments on commit 0c7880b

@khanali21
Copy link

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

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

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.