@@ -86,6 +86,8 @@ public class PmdPublisher extends HealthAwarePublisher {
86
86
* annotation threshold
87
87
* @param canRunOnFailed
88
88
* determines whether the plug-in can run for failed builds, too
89
+ * @param useStableBuildAsReference
90
+ * determines whether only stable builds should be used as reference builds or not
89
91
* @param canComputeNew
90
92
* determines whether new warnings should be computed (with
91
93
* respect to baseline)
@@ -103,14 +105,14 @@ public PmdPublisher(final String healthy, final String unHealthy, final String t
103
105
final String unstableNewAll , final String unstableNewHigh , final String unstableNewNormal , final String unstableNewLow ,
104
106
final String failedTotalAll , final String failedTotalHigh , final String failedTotalNormal , final String failedTotalLow ,
105
107
final String failedNewAll , final String failedNewHigh , final String failedNewNormal , final String failedNewLow ,
106
- final boolean canRunOnFailed , final boolean shouldDetectModules , final boolean canComputeNew ,
107
- final String pattern ) {
108
+ final boolean canRunOnFailed , final boolean useStableBuildAsReference , final boolean shouldDetectModules ,
109
+ final boolean canComputeNew , final String pattern ) {
108
110
super (healthy , unHealthy , thresholdLimit , defaultEncoding , useDeltaValues ,
109
111
unstableTotalAll , unstableTotalHigh , unstableTotalNormal , unstableTotalLow ,
110
112
unstableNewAll , unstableNewHigh , unstableNewNormal , unstableNewLow ,
111
113
failedTotalAll , failedTotalHigh , failedTotalNormal , failedTotalLow ,
112
114
failedNewAll , failedNewHigh , failedNewNormal , failedNewLow ,
113
- canRunOnFailed , shouldDetectModules , canComputeNew , PLUGIN_NAME );
115
+ canRunOnFailed , useStableBuildAsReference , shouldDetectModules , canComputeNew , false , PLUGIN_NAME );
114
116
this .pattern = pattern ;
115
117
}
116
118
// CHECKSTYLE:ON
@@ -137,7 +139,7 @@ public BuildResult perform(final AbstractBuild<?, ?> build, final PluginLogger l
137
139
ParserResult project = build .getWorkspace ().act (pmdCollector );
138
140
logger .logLines (project .getLogMessages ());
139
141
140
- PmdResult result = new PmdResult (build , getDefaultEncoding (), project );
142
+ PmdResult result = new PmdResult (build , getDefaultEncoding (), project , useOnlyStableBuildsAsReference () );
141
143
build .getActions ().add (new PmdResultAction (build , this , result ));
142
144
143
145
return result ;
@@ -151,6 +153,6 @@ public PmdDescriptor getDescriptor() {
151
153
/** {@inheritDoc} */
152
154
public MatrixAggregator createAggregator (final MatrixBuild build , final Launcher launcher ,
153
155
final BuildListener listener ) {
154
- return new PmdAnnotationsAggregator (build , launcher , listener , this , getDefaultEncoding ());
156
+ return new PmdAnnotationsAggregator (build , launcher , listener , this , getDefaultEncoding (), useOnlyStableBuildsAsReference () );
155
157
}
156
158
}
0 commit comments