Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[FIXED JENKINS-16250] Use outputFile configuration option if available.
  • Loading branch information
uhafner committed Feb 12, 2013
1 parent 4a309eb commit e79892bdb3873059ab04ad1e0569311262353f4c
Showing with 16 additions and 4 deletions.
  1. +2 −2 pom.xml
  2. +14 −2 src/main/java/hudson/plugins/checkstyle/CheckStyleReporter.java
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-pom</artifactId>
<version>1.40</version>
<version>1.42</version>
<relativePath>../analysis-pom/pom.xml</relativePath>
</parent>

@@ -32,7 +32,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.48</version>
<version>1.49-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
@@ -1,5 +1,6 @@
package hudson.plugins.checkstyle;

import hudson.FilePath;
import hudson.maven.MavenAggregatedReport;
import hudson.maven.MavenBuildProxy;
import hudson.maven.MojoInfo;
@@ -10,12 +11,14 @@
import hudson.plugins.analysis.core.ParserResult;
import hudson.plugins.analysis.util.PluginLogger;
import hudson.plugins.checkstyle.parser.CheckStyleParser;
import hudson.remoting.VirtualChannel;

import java.io.IOException;
import java.util.Collections;
import java.util.List;

import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
import org.kohsuke.stapler.DataBoundConstructor;

/**
@@ -115,9 +118,18 @@ protected boolean acceptGoal(final String goal) {
public ParserResult perform(final MavenBuildProxy build, final MavenProject pom,
final MojoInfo mojo, final PluginLogger logger) throws InterruptedException, IOException {
FilesParser checkstyleCollector = new FilesParser(PLUGIN_NAME,
CHECKSTYLE_XML_FILE, new CheckStyleParser(getDefaultEncoding()), getModuleName(pom));
new CheckStyleParser(getDefaultEncoding()), getModuleName(pom));

return getTargetPath(pom).act(checkstyleCollector);
return getFileName(mojo, pom).act(checkstyleCollector);
}

private FilePath getFileName(final MojoInfo mojo, final MavenProject pom) {
try {
return new FilePath((VirtualChannel)null, mojo.getConfigurationValue("outputFile", String.class));
}
catch (ComponentConfigurationException exception) {
return getTargetPath(pom).child(CHECKSTYLE_XML_FILE);
}
}

@Override

0 comments on commit e79892b

Please sign in to comment.