File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,44 @@ else
194
194
print_errors_summary 'rflint' , errors_count , 'https://github.com/php-coder/mystamps/wiki/rflint'
195
195
end
196
196
197
+ # Handle `mvn enforcer:enforce` results
198
+ enforcer_output = 'enforcer.log'
199
+ unless File . file? ( enforcer_output )
200
+ warn ( "Couldn't find #{ enforcer_report } . maven-enforcer-plugin result is unknown" )
201
+ else
202
+ errors = [ ]
203
+ plugin_output_started = false
204
+ File . readlines ( enforcer_output ) . each do |line |
205
+ # We're interesting in everything between
206
+ # [INFO] --- maven-enforcer-plugin:1.4.1:enforce (default-cli) @ mystamps ---
207
+ # and
208
+ # [INFO] ------------------------------------------------------------------------
209
+ # lines
210
+
211
+ if line . start_with? '[INFO] --- maven-enforcer-plugin:'
212
+ plugin_output_started = true
213
+ next
214
+ end
215
+
216
+ unless plugin_output_started
217
+ next
218
+ end
219
+
220
+ if line . start_with? '[INFO] -----'
221
+ break
222
+ end
223
+
224
+ line . sub! ( '[WARNING] ' , '' )
225
+ errors << line
226
+ end
227
+
228
+ unless errors . empty?
229
+ error_msgs = errors . join ( )
230
+ fail ( "maven-enforcer-plugin reported about errors. Please, fix them. " \
231
+ "Here is its output:\n ```\n #{ error_msgs } ```" )
232
+ end
233
+ end
234
+
197
235
# Handle `mvn findbugs:check` results
198
236
findbugs_report = 'target/findbugsXml.xml'
199
237
unless File . file? ( findbugs_report )
You can’t perform that action at this time.
0 commit comments