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-16250] Use outputFile configuration option if available.
  • Loading branch information
uhafner committed Feb 12, 2013
1 parent 4a309eb commit e79892b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -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>

Expand Down Expand Up @@ -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>
Expand Down
16 changes: 14 additions & 2 deletions src/main/java/hudson/plugins/checkstyle/CheckStyleReporter.java
@@ -1,5 +1,6 @@
package hudson.plugins.checkstyle;

import hudson.FilePath;
import hudson.maven.MavenAggregatedReport;
import hudson.maven.MavenBuildProxy;
import hudson.maven.MojoInfo;
Expand All @@ -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;

/**
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e79892b

Please sign in to comment.