This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JENKINS-4912] Created new action base class for maven aggregation.
- Loading branch information
Showing
4 changed files
with
83 additions
and
80 deletions.
There are no files selected for viewing
37 changes: 0 additions & 37 deletions
37
plugin/src/main/java/hudson/plugins/findbugs/FindBugsMavenResult.java
This file was deleted.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
plugin/src/main/java/hudson/plugins/findbugs/FindBugsMavenResultAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package hudson.plugins.findbugs; | ||
|
||
import hudson.maven.MavenAggregatedReport; | ||
import hudson.maven.MavenBuild; | ||
import hudson.maven.MavenModule; | ||
import hudson.maven.MavenModuleSet; | ||
import hudson.maven.MavenModuleSetBuild; | ||
import hudson.model.Action; | ||
import hudson.plugins.analysis.core.HealthDescriptor; | ||
import hudson.plugins.analysis.core.MavenResultAction; | ||
import hudson.plugins.analysis.core.ParserResult; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* A {@link FindBugsResultAction} for native Maven jobs. This action | ||
* additionally provides result aggregation for sub-modules and for the main | ||
* project. | ||
* | ||
* @author Ulli Hafner | ||
*/ | ||
public class FindBugsMavenResultAction extends MavenResultAction<FindBugsResult> { | ||
/** | ||
* Creates a new instance of {@link FindBugsMavenResultAction}. This instance | ||
* will have no result set in the beginning. The result will be set | ||
* successively after each of the modules are build. | ||
* | ||
* @param owner | ||
* the associated build of this action | ||
* @param healthDescriptor | ||
* health descriptor to use | ||
* @param defaultEncoding | ||
* the default encoding to be used when reading and parsing files | ||
*/ | ||
public FindBugsMavenResultAction(final MavenModuleSetBuild owner, final HealthDescriptor healthDescriptor, | ||
final String defaultEncoding) { | ||
super(new FindBugsResultAction(owner, healthDescriptor), defaultEncoding); | ||
} | ||
|
||
/** | ||
* Creates a new instance of {@link FindBugsMavenResultAction}. | ||
* | ||
* @param owner | ||
* the associated build of this action | ||
* @param healthDescriptor | ||
* health descriptor to use | ||
* @param defaultEncoding | ||
* the default encoding to be used when reading and parsing files | ||
* @param result | ||
* the result in this build | ||
*/ | ||
public FindBugsMavenResultAction(final MavenBuild owner, final HealthDescriptor healthDescriptor, | ||
final String defaultEncoding, final FindBugsResult result) { | ||
super(new FindBugsResultAction(owner, healthDescriptor, result), defaultEncoding); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public MavenAggregatedReport createAggregatedAction(final MavenModuleSetBuild build, final Map<MavenModule, List<MavenBuild>> moduleBuilds) { | ||
return new FindBugsMavenResultAction(build, getHealthDescriptor(), getDisplayName()); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public Action getProjectAction(final MavenModuleSet moduleSet) { | ||
return new FindBugsProjectAction(moduleSet); | ||
} | ||
|
||
@Override | ||
public Class<? extends MavenResultAction<FindBugsResult>> getIndividualActionType() { | ||
return FindBugsMavenResultAction.class; | ||
} | ||
|
||
@Override | ||
protected FindBugsResult createResult(final FindBugsResult existingResult, final ParserResult aggregatedAnnotations) { | ||
return new FindBugsResult(getOwner(), existingResult.getDefaultEncoding(), aggregatedAnnotations); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters