This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b0563c  Update/improve variable names
8b0563c is described below

commit 8b0563c5952c42e1178c0117492d72b15e36aa37
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Sun Dec 10 00:04:00 2023 +0100

    Update/improve variable names
    
    During iterative intergration of new milestones into plugins many names have
    been clarified and unified.
---
 .../maven/reporting/its/custom/ExternalReport.java | 24 ++++++++++------------
 .../use-as-direct-mojo-markup/invoker.properties   |  6 +++---
 src/it/use-as-direct-mojo-markup/pom.xml           | 10 +++++++++
 src/it/use-as-direct-mojo-markup/verify.groovy     | 10 ++++-----
 src/it/use-as-direct-mojo/invoker.properties       |  6 +++---
 src/it/use-as-direct-mojo/pom.xml                  | 10 +++++++++
 src/it/use-as-direct-mojo/verify.groovy            |  8 ++++----
 7 files changed, 46 insertions(+), 28 deletions(-)

diff --git 
a/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
 
b/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
index 2fbb6a9..504fa97 100644
--- 
a/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
+++ 
b/src/it/setup-reporting-plugin/src/main/java/org/apache/maven/reporting/its/custom/ExternalReport.java
@@ -38,14 +38,14 @@ public class ExternalReport
     extends AbstractMavenReport
 {
     /**
-     * The name of the destination directory inside the site.
+     * The name of the output directory inside the reports.
      */
-    @Parameter( property = "destDir", defaultValue = "external" )
-    private String destDir;
+    @Parameter( property = "outputDirName", defaultValue = "external" )
+    private String outputDirName;
 
     public String getOutputName()
     {
-        return destDir + "/report";
+        return outputDirName + "/report";
     }
 
     public String getName( Locale locale )
@@ -69,7 +69,7 @@ public class ExternalReport
     {
         try
         {
-            executeExternalTool( getOutputDirectory() + '/' + destDir );
+            executeExternalTool( new File( getReportOutputDirectory(), 
outputDirName ) );
         }
         catch ( IOException ioe )
         {
@@ -80,19 +80,17 @@ public class ExternalReport
     /**
      * Invoke the external tool to generate report.
      *
-     * @param destination destination directory
+     * @param destDir destination directory
      */
-    private void executeExternalTool( String destination )
+    private void executeExternalTool( File destDir )
         throws IOException
     {
-        getLog().info( "Running external tool to " + destination );
+        getLog().info( "Running external tool to " + destDir );
 
         // demo implementation, to be replaced with effective tool
-        File dest = new File( destination );
+        destDir.mkdirs();
 
-        dest.mkdirs();
-
-        File report = new File( dest, "report.html" );
-        FileUtils.fileWrite( report, "UTF-8", "<html><body><h1>External 
Report</h1></body></html>" );
+        File reportFile = new File( destDir, "report.html" );
+        FileUtils.fileWrite( reportFile, "UTF-8", "<html><body><h1>External 
Report</h1></body></html>" );
     }
 }
diff --git a/src/it/use-as-direct-mojo-markup/invoker.properties 
b/src/it/use-as-direct-mojo-markup/invoker.properties
index 3381aa4..a0197fd 100644
--- a/src/it/use-as-direct-mojo-markup/invoker.properties
+++ b/src/it/use-as-direct-mojo-markup/invoker.properties
@@ -15,6 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-invoker.goals.1 = 
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:custom 
-Doutput.format=xdoc
-invoker.goals.2 = 
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:custom-renderer
 -Doutput.format=apt
-invoker.goals.3 = 
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:external 
-Doutput.format=anything
+invoker.goals.1 = custom-reporting:custom -Doutput.format=xdoc
+invoker.goals.2 = custom-reporting:custom-renderer -Doutput.format=apt
+invoker.goals.3 = custom-reporting:external -Doutput.format=anything
diff --git a/src/it/use-as-direct-mojo-markup/pom.xml 
b/src/it/use-as-direct-mojo-markup/pom.xml
index 445d85e..e6895b9 100644
--- a/src/it/use-as-direct-mojo-markup/pom.xml
+++ b/src/it/use-as-direct-mojo-markup/pom.xml
@@ -30,4 +30,14 @@ under the License.
 
   <name>Use report as direct mojo to markup</name>
   <description>Use report directly as mojo to markup: "mvn 
my-plugin:my-report"</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.reporting.its</groupId>
+        <artifactId>custom-reporting-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </plugin>
+    </plugins>
+  </build>
 </project>
diff --git a/src/it/use-as-direct-mojo-markup/verify.groovy 
b/src/it/use-as-direct-mojo-markup/verify.groovy
index 5773ff2..2bb2483 100644
--- a/src/it/use-as-direct-mojo-markup/verify.groovy
+++ b/src/it/use-as-direct-mojo-markup/verify.groovy
@@ -17,18 +17,18 @@
  * under the License.
  */
 
-File site = new File( basedir, 'target/site/' )
+File outputDir = new File( basedir, 'target/site/' )
 
-File f = new File( site, 'custom-report.xdoc' );
+File f = new File( outputDir, 'custom-report.xdoc' );
 assert f.exists();
 assert f.text.contains( 'Custom Maven Report content.' );
 
-f = new File( site, 'custom-report-with-renderer.apt' );
+f = new File( outputDir, 'custom-report-with-renderer.apt' );
 assert f.exists();
 assert f.text.contains( 'Custom Maven Report with Renderer content.' );
 
-f = new File( site, 'external/report.html' );
+f = new File( outputDir, 'external/report.html' );
 assert f.exists();
 assert f.text.contains( '<h1>External Report</h1>' );
 
-return true;
\ No newline at end of file
+return true;
diff --git a/src/it/use-as-direct-mojo/invoker.properties 
b/src/it/use-as-direct-mojo/invoker.properties
index 42853b4..e6cbf2d 100644
--- a/src/it/use-as-direct-mojo/invoker.properties
+++ b/src/it/use-as-direct-mojo/invoker.properties
@@ -15,6 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-invoker.goals.1 = 
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:custom
-invoker.goals.2 = 
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:custom-renderer
-invoker.goals.3 = 
org.apache.maven.reporting.its:custom-reporting-plugin:1.0-SNAPSHOT:external
+invoker.goals.1 = custom-reporting:custom
+invoker.goals.2 = custom-reporting:custom-renderer
+invoker.goals.3 = custom-reporting:external
diff --git a/src/it/use-as-direct-mojo/pom.xml 
b/src/it/use-as-direct-mojo/pom.xml
index 09dab3a..9b54eb3 100644
--- a/src/it/use-as-direct-mojo/pom.xml
+++ b/src/it/use-as-direct-mojo/pom.xml
@@ -30,4 +30,14 @@ under the License.
 
   <name>Use report as direct mojo</name>
   <description>Use report directly as mojo: "mvn 
my-plugin:my-report"</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.reporting.its</groupId>
+        <artifactId>custom-reporting-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </plugin>
+    </plugins>
+  </build>
 </project>
diff --git a/src/it/use-as-direct-mojo/verify.groovy 
b/src/it/use-as-direct-mojo/verify.groovy
index c419352..3e4f303 100644
--- a/src/it/use-as-direct-mojo/verify.groovy
+++ b/src/it/use-as-direct-mojo/verify.groovy
@@ -17,13 +17,13 @@
  * under the License.
  */
 
-File site = new File( basedir, 'target/site/' )
+File outputDir = new File( basedir, 'target/site/' )
 
-File f = new File( site, 'custom-report.html' );
+File f = new File( outputDir, 'custom-report.html' );
 assert f.exists();
 assert f.text.contains( 'Custom Maven Report content.' );
 
-f = new File( site, 'custom-report-with-renderer.html' );
+f = new File( outputDir, 'custom-report-with-renderer.html' );
 assert f.exists();
 text = f.text.normalize();
 assert text.contains( 'Custom Maven Report with Renderer content.' );
@@ -33,7 +33,7 @@ assert text.contains( '''\
 assert text.contains( '''\
 <div class="verbatim source"><pre class="prettyprint">var custom_code = 
true;</pre></div>'''.normalize() );
 
-f = new File( site, 'external/report.html' );
+f = new File( outputDir, 'external/report.html' );
 assert f.exists();
 assert f.text.contains( '<h1>External Report</h1>' );
 

Reply via email to