Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[JENKINS-9090] Added project configuration option to activate
scanning of workspace for build.xml and pom.xml files to detect
the module names of warnings.
  • Loading branch information
uhafner committed Apr 7, 2011
1 parent 523b32b commit 3578cec72b3e399dd29e6d245900ba97df16cc13
Showing 1 changed file with 13 additions and 4 deletions.
@@ -85,6 +85,8 @@ public class FindBugsPublisher extends HealthAwarePublisher {
* annotation threshold
* @param canRunOnFailed
* determines whether the plug-in can run for failed builds, too
* @param shouldDetectModules
* determines whether module names should be derived from Maven POM or Ant build files
* @param pattern
* Ant file-set pattern to scan for FindBugs files
*/
@@ -97,14 +99,14 @@ public FindBugsPublisher(final String healthy, final String unHealthy, final Str
final String unstableNewAll, final String unstableNewHigh, final String unstableNewNormal, final String unstableNewLow,
final String failedTotalAll, final String failedTotalHigh, final String failedTotalNormal, final String failedTotalLow,
final String failedNewAll, final String failedNewHigh, final String failedNewNormal, final String failedNewLow,
final boolean canRunOnFailed,
final boolean canRunOnFailed, final boolean shouldDetectModules,
final String pattern) {
super(healthy, unHealthy, thresholdLimit, defaultEncoding, useDeltaValues,
unstableTotalAll, unstableTotalHigh, unstableTotalNormal, unstableTotalLow,
unstableNewAll, unstableNewHigh, unstableNewNormal, unstableNewLow,
failedTotalAll, failedTotalHigh, failedTotalNormal, failedTotalLow,
failedNewAll, failedNewHigh, failedNewNormal, failedNewLow,
canRunOnFailed, "FINDBUGS");
canRunOnFailed, shouldDetectModules, "FINDBUGS");
this.pattern = pattern;
}
// CHECKSTYLE:ON
@@ -130,8 +132,15 @@ public BuildResult perform(final AbstractBuild<?, ?> build, final PluginLogger l
logger.log("Collecting findbugs analysis files...");

String defaultPattern = isMavenBuild(build) ? MAVEN_DEFAULT_PATTERN : ANT_DEFAULT_PATTERN;
FilesParser collector = new FilesParser(logger, StringUtils.defaultIfEmpty(getPattern(), defaultPattern),
new FindBugsParser(), isMavenBuild(build), isAntBuild(build));
FilesParser collector;
if (shouldDetectModules()) {
collector = new FilesParser(logger, StringUtils.defaultIfEmpty(getPattern(),
defaultPattern), new FindBugsParser(), isMavenBuild(build), isAntBuild(build));
}
else {
collector = new FilesParser(logger, StringUtils.defaultIfEmpty(getPattern(),
defaultPattern), new FindBugsParser());
}
ParserResult project = build.getWorkspace().act(collector);
FindBugsResult result = new FindBugsResult(build, getDefaultEncoding(), project);

0 comments on commit 3578cec

Please sign in to comment.