@@ -377,40 +377,18 @@ protected ResourceBundle getBundle(Locale locale) {
377
377
return ResourceBundle .getBundle ("jxr-report" , locale , this .getClass ().getClassLoader ());
378
378
}
379
379
380
- /**
381
- * Checks whether the report can be generated.
382
- *
383
- * @param sourceDirs list of source directories
384
- * @return true if the report could be generated
385
- */
386
- protected boolean canGenerateReport (List <String > sourceDirs ) {
387
- boolean canGenerate = !sourceDirs .isEmpty ();
388
-
389
- if (isAggregate () && !project .isExecutionRoot ()) {
390
- canGenerate = false ;
391
- }
392
- return canGenerate ;
393
- }
394
-
395
380
@ Override
396
381
protected void executeReport (Locale locale ) throws MavenReportException {
397
- if (skip ) {
398
- getLog ().info ("Skipping JXR." );
399
- return ;
400
- }
401
- List <String > sourceDirs = constructSourceDirs ();
402
- if (canGenerateReport (sourceDirs )) {
403
- // init some attributes -- TODO (javadoc)
404
- init ();
382
+ // init some attributes -- TODO (javadoc)
383
+ init ();
405
384
406
- // determine version of templates to use
407
- setJavadocTemplatesVersion ();
385
+ // determine version of templates to use
386
+ setJavadocTemplatesVersion ();
408
387
409
- try {
410
- createXref (locale , getDestinationDirectory (), sourceDirs );
411
- } catch (JxrException | IOException e ) {
412
- throw new MavenReportException ("Error while generating the HTML source code of the project." , e );
413
- }
388
+ try {
389
+ createXref (locale , getDestinationDirectory (), constructSourceDirs ());
390
+ } catch (JxrException | IOException e ) {
391
+ throw new MavenReportException ("Error while generating the HTML source code of the project." , e );
414
392
}
415
393
}
416
394
@@ -471,7 +449,20 @@ protected List<String> constructSourceDirs() {
471
449
472
450
@ Override
473
451
public boolean canGenerateReport () {
474
- return canGenerateReport (constructSourceDirs ());
452
+ if (skip ) {
453
+ getLog ().info ("Skipping JXR." );
454
+ return false ;
455
+ }
456
+
457
+ if (constructSourceDirs ().isEmpty ()) {
458
+ return false ;
459
+ }
460
+
461
+ if (isAggregate () && !project .isExecutionRoot ()) {
462
+ return false ;
463
+ }
464
+
465
+ return true ;
475
466
}
476
467
477
468
@ Override
0 commit comments