@@ -61,27 +61,29 @@ public void execute() throws MojoExecutionException {
6161
6262 try {
6363 // Build classpath for test classes
64- URLClassLoader classLoader = createTestClassLoader ();
64+ try ( URLClassLoader classLoader = createTestClassLoader ()) {
6565
66- // Parse Surefire reports to find executed tests
67- List <ExecutedTest > executedTests = TagSurefireFacade .parseSurefireReports ( this .surefireReportsDirectory , this .includeSkipped );
66+ // Parse Surefire reports to find executed tests
67+ List <ExecutedTest > executedTests = TagSurefireFacade .parseSurefireReports ( this .surefireReportsDirectory , this .includeSkipped );
6868
69- getLog ().info ("Found " + executedTests .size () + " executed tests" );
69+ getLog ().info ("Found " + executedTests .size () + " executed tests" );
7070
71- // Extract tags from executed tests
72- Map <ExecutedTest , Set <String >> testTagMap =
73- TagScanFacade .extractTagsFromExecutedTests (executedTests , classLoader );
71+ // Extract tags from executed tests
72+ Map <ExecutedTest , Set <String >> testTagMap =
73+ TagScanFacade .extractTagsFromExecutedTests (executedTests , classLoader );
7474
75- // Generate report
76- TagReportFacade .generateReport ( this .format , this .includeSkipped , this .outputFile , testTagMap );
75+ // Generate report
76+ TagReportFacade .generateReport ( this .format , this .includeSkipped , this .outputFile , testTagMap );
7777
78- // Check for required tags
79- if (requiredTags != null && !requiredTags .isEmpty ()) {
80- TagCheckFacade .checkRequiredTags ( this .requiredTags , this .failOnMissingTag , testTagMap );
81- }
78+ // Check for required tags
79+ if (requiredTags != null && !requiredTags .isEmpty ()) {
80+ TagCheckFacade .checkRequiredTags ( this .requiredTags , this .failOnMissingTag , testTagMap );
81+ }
82+
83+ getLog ().info ("Executed Test Tag Report generated: " +
84+ outputFile .getAbsolutePath ());
8285
83- getLog ().info ("Executed Test Tag Report generated: " +
84- outputFile .getAbsolutePath ());
86+ }
8587
8688 } catch (Exception e ) {
8789 throw new MojoExecutionException ("Error generating executed test tag report" , e );
0 commit comments