From 0e94f5b36d83c83fd279c98db22d1c3c5f2ebb5d Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 22 Oct 2023 22:43:29 +0200 Subject: [PATCH] Directory, not folder --- .../maven/plugin/jxr/AbstractJxrReport.java | 10 +- .../apache/maven/plugin/jxr/JxrReport.java | 4 +- .../maven/plugin/jxr/JxrTestReport.java | 4 +- .../apache/maven/plugin/jxr/JxrReport.html | 108 +++++++++--------- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java index b239be91..29b336a6 100644 --- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java +++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java @@ -181,7 +181,7 @@ protected void init() { * Checks whether the given directory contains Java files. * * @param dir the source directory - * @return true if the folder or one of its subfolders contains at least 1 Java file + * @return true if the directory or one of its subdirectories contains at least 1 Java file */ private boolean hasSources(File dir) { if (dir.exists() && dir.isDirectory()) { @@ -206,7 +206,7 @@ && hasSources(currentFile)) { * directory. * * @param locale The user locale to use for the Xref generation - * @param destinationDirectory The output folder + * @param destinationDirectory The output directory * @param sourceDirs The source directories * @throws java.io.IOException * @throws org.apache.maven.jxr.JxrException @@ -339,13 +339,13 @@ private void copyRequiredResources(String dir) { * Copy styles and related resources to the given directory * * @param dir the directory to copy the resources to - * @param sourceFolder resources subfolder to copy from + * @param sourceDirectory resources subdirectory to copy from * @param files names of files to copy */ - private void copyResources(String dir, String sourceFolder, String... files) { + private void copyResources(String dir, String sourceDirectory, String... files) { try { for (String file : files) { - URL resourceUrl = this.getClass().getClassLoader().getResource(sourceFolder + file); + URL resourceUrl = this.getClass().getClassLoader().getResource(sourceDirectory + file); File destResourceFile = new File(dir, file); FileUtils.copyURLToFile(resourceUrl, destResourceFile); } diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java index 7740d02a..6a348f2b 100644 --- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java +++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java @@ -53,13 +53,13 @@ public class JxrReport extends AbstractJxrReport { private String sourcePath; /** - * Folder where the Xref files will be copied to. + * Directory where the Xref files will be copied to. */ @Parameter(defaultValue = "${project.reporting.outputDirectory}/xref") private String destDir; /** - * Folder where Javadoc is generated for this project. + * Directory where Javadoc is generated for this project. */ @Parameter(defaultValue = "${project.reporting.outputDirectory}/apidocs") private File javadocDir; diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java index 62d51405..1f9d1584 100644 --- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java +++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java @@ -46,13 +46,13 @@ public class JxrTestReport extends AbstractJxrReport { private List sourceDirs; /** - * Folder where the Xref files will be copied to. + * Directory where the Xref files will be copied to. */ @Parameter(defaultValue = "${project.reporting.outputDirectory}/xref-test") private String destDir; /** - * Folder where Test Javadoc is generated for this project. + * Directory where Test Javadoc is generated for this project. */ @Parameter(defaultValue = "${project.reporting.outputDirectory}/testapidocs") private File testJavadocDir; diff --git a/maven-jxr-plugin/src/site/resources/example/xref/org/apache/maven/plugin/jxr/JxrReport.html b/maven-jxr-plugin/src/site/resources/example/xref/org/apache/maven/plugin/jxr/JxrReport.html index 2e228e7c..4e3679d2 100644 --- a/maven-jxr-plugin/src/site/resources/example/xref/org/apache/maven/plugin/jxr/JxrReport.html +++ b/maven-jxr-plugin/src/site/resources/example/xref/org/apache/maven/plugin/jxr/JxrReport.html @@ -27,7 +27,7 @@
 
 1   package org.apache.maven.plugin.jxr;
-2   
+2
 3   /*
 4    * Copyright 2004-2005 The Apache Software Foundation.
 5    *
@@ -43,7 +43,7 @@
 15   * See the License for the specific language governing permissions and
 16   * limitations under the License.
 17   */
-18  
+18
 19  import org.apache.maven.jxr.JXR;
 20  import org.apache.maven.model.ReportPlugin;
 21  import org.apache.maven.project.MavenProject;
@@ -52,7 +52,7 @@
 24  import org.codehaus.doxia.sink.Sink;
 25  import org.codehaus.doxia.site.renderer.SiteRenderer;
 26  import org.codehaus.plexus.util.FileUtils;
-27  
+27
 28  import java.io.File;
 29  import java.io.IOException;
 30  import java.net.URL;
@@ -61,7 +61,7 @@
 33  import java.util.List;
 34  import java.util.Locale;
 35  import java.util.ResourceBundle;
-36  
+36
 37  /***
 38   * MOJO for the JXR report.<br>
 39   * Creates an html-based, cross referenced version of Java source code
@@ -73,74 +73,74 @@
 45  public class JxrReport
 46      extends AbstractMavenReport
 47  {
-48  
+48
 49      /***
 50       * @parameter expression="${project}"
 51       * @required @readonly
 52       */
 53      private MavenProject project;
-54  
+54
 55      /***
 56       * @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}"
 57       * @required @readonly
 58       */
 59      private SiteRenderer siteRenderer;
-60  
+60
 61      /***
 62       * @parameter expression="${project.compileSourceRoots}"
 63       * @required
 64       * @readonly
 65       */
 66      private List sourceDirs;
-67  
+67
 68      /***
 69       * @parameter expression="${project.testCompileSourceRoots}"
 70       * @required
 71       * @readonly
 72       */
 73      private List testSourceDirs;
-74  
+74
 75      /***
 76       * @parameter expression="${project.build.directory}/site"
 77       * @required
 78       */
 79      private String outputDirectory;
-80  
+80
 81      /***
 82       * @parameter expression="${project.build.directory}/site/xref"
 83       */
 84      private String destDir;
-85  
+85
 86      /***
 87       * @parameter default-value="ISO-8859-1"
 88       */
 89      private String inputEncoding;
-90  
+90
 91      /***
 92       * @parameter default-value="ISO-8859-1"
 93       */
 94      private String outputEncoding;
-95  
+95
 96      /***
 97       * @parameter expression="${project.build.directory}/site/apidocs"
 98       */
 99      private String javadocDir;
-100 
+100
 101     /***
 102      * @parameter expression="${project.name} ${project.version} Reference"
 103      */
 104     private String windowTitle;
-105 
+105
 106     /***
 107      * @parameter expression="${project.name} ${project.version} Reference"
 108      */
 109     private String docTitle;
-110 
+110
 111     /***
 112      * @parameter expression="Copyright &copy; ${project.inceptionYear} ${project.organization.name}. All Rights Reserved."
 113      */
 114     private String bottom;
-115 
+115
 116     /***
 117      * Directory where Velocity templates can be found to generate overviews,
 118      * frames and summaries.<br>
@@ -149,17 +149,17 @@
 121      * @parameter default-value="templates"
 122      */
 123     private String templateDir;
-124 
+124
 125     /***
 126      * @parameter default-value="stylesheet.css"
 127      */
 128     private String stylesheet;
-129 
+129
 130     /*
 131      * Tells whether Javadoc is part of the reports being generated during the build
 132      */
 133     private boolean javadocReportGenerated;
-134 
+134
 135     /***
 136      * Cf. overriden method documentation.
 137      *
@@ -170,21 +170,21 @@
 142     {
 143         // init some attributes
 144         init();
-145 
+145
 146         // and start the report 
 147         Sink sink = getSink();
-148 
+148
 149         startSink( sink, locale );
-150 
+150
 151         // check if there are sources in the sourceDir and generate Xref
 152         generateXrefForSources( locale, sink );
-153 
+153
 154         // check if there are test sources in the testSourceDir and generate Xref
 155         generateXrefForTests( locale, sink );
-156 
+156
 157         endSink( sink );
 158     }
-159 
+159
 160     /*
 161      * Generates the Xref for the application sources if they exist
 162      */
@@ -202,7 +202,7 @@
 174             {
 175                 // create the XRef for the source dir
 176                 createXref( locale, destDir, sourceDirs );
-177 
+177
 178                 // put the link to the sources
 179                 sink.text( getBundle( locale ).getString( "report.xref.projectSources.link" ) );
 180                 File out = new File( outputDirectory );
@@ -224,7 +224,7 @@
 196         sink.paragraph_();
 197         sink.section2_();
 198     }
-199 
+199
 200     private boolean hasSources( List sourceDirs )
 201     {
 202         boolean found = false;
@@ -238,7 +238,7 @@
 210         }
 211         return found;
 212     }
-213 
+213
 214     /*
 215      * Generates the Xref for the test sources if they exist
 216      */
@@ -255,10 +255,10 @@
 227             try
 228             {
 229                 String testDestDir = destDir + "-test";
-230 
+230
 231                 // create the XRef for the source dir
 232                 createXref( locale, testDestDir, testSourceDirs );
-233 
+233
 234                 // put the link to the sources
 235                 sink.text( getBundle( locale ).getString( "report.xref.testSources.link" ) );
 236                 File out = new File( outputDirectory );
@@ -280,7 +280,7 @@
 252         sink.paragraph_();
 253         sink.section2_();
 254     }
-255 
+255
 256     /*
 257      * Initialize some attributes required during the report generation
 258      */
@@ -302,7 +302,7 @@
 274             }
 275         }
 276     }
-277 
+277
 278     /***
 279      * Writes the beginning of the sink.
 280      *
@@ -316,19 +316,19 @@
 288         sink.text( getBundle( locale ).getString( "report.xref.header" ) );
 289         sink.title_();
 290         sink.head_();
-291 
+291
 292         sink.body();
 293         sink.section1();
-294 
+294
 295         sink.sectionTitle1();
 296         sink.text( getBundle( locale ).getString( "report.xref.mainTitle" ) );
 297         sink.sectionTitle1_();
-298 
+298
 299         sink.paragraph();
 300         sink.text( getBundle( locale ).getString( "report.xref.summary" ) );
 301         sink.paragraph_();
 302     }
-303 
+303
 304     /***
 305      * Writes the end of the sink.
 306      *
@@ -341,12 +341,12 @@
 313         sink.flush();
 314         sink.close();
 315     }
-316 
+316
 317     /***
 318      * Checks whether the given directory contains Java files.
 319      *
 320      * @param dir the source directory
-321      * @return true if the folder or one of its subfolders coantins at least 1 Java file
+321      * @return true if the directory or one of its subdirectories coantins at least 1 Java file
 322      */
 323     private boolean hasSources( File dir )
 324     {
@@ -373,13 +373,13 @@
 345         }
 346         return false;
 347     }
-348 
+348
 349     /***
 350      * Creates the Xref for the Java files found in the given source directory and puts
 351      * them in the given destination directory.
 352      *
 353      * @param locale The user locale to use for the Xref generation
-354      * @param destinationDirectory The output folder
+354      * @param destinationDirectory The output directory
 355      * @param sourceDirs The source directories
 356      * @throws IOException
 357      * @throws Exception
@@ -395,13 +395,13 @@
 367         jxr.setLog( new PluginLogAdapter( getLog() ) );
 368         jxr.setOutputEncoding( outputEncoding );
 369         jxr.setRevision( "HEAD" );
-370 
+370
 371         jxr.xref( sourceDirs, templateDir, windowTitle, docTitle, bottom );
-372 
+372
 373         // and finally copy the stylesheet
 374         copyRequiredResources( destinationDirectory );
 375     }
-376 
+376
 377     /***
 378      * Copy some required resources (like the stylesheet) to the
 379      * given directory
@@ -412,7 +412,7 @@
 384     {
 385         File stylesheetFile = new File( stylesheet );
 386         File destStylesheetFile = new File( dir, "stylesheet.css" );
-387 
+387
 388         try
 389         {
 390             if ( stylesheetFile.isAbsolute() )
@@ -429,9 +429,9 @@
 401         {
 402             getLog().warn( "An error occured while copying the stylesheet to the target directory", e );
 403         }
-404 
+404
 405     }
-406 
+406
 407     /***
 408      * Cf. overriden method documentation.
 409      *
@@ -441,7 +441,7 @@
 413     {
 414         return siteRenderer;
 415     }
-416 
+416
 417     /***
 418      * Cf. overriden method documentation.
 419      *
@@ -451,7 +451,7 @@
 423     {
 424         return outputDirectory;
 425     }
-426 
+426
 427     /***
 428      * Cf. overriden method documentation.
 429      *
@@ -461,7 +461,7 @@
 433     {
 434         return project;
 435     }
-436 
+436
 437     /***
 438      * Cf. overriden method documentation.
 439      *
@@ -471,7 +471,7 @@
 443     {
 444         return getBundle( locale ).getString( "report.xref.description" );
 445     }
-446 
+446
 447     /***
 448      * Cf. overriden method documentation.
 449      *
@@ -481,7 +481,7 @@
 453     {
 454         return getBundle( locale ).getString( "report.xref.name" );
 455     }
-456 
+456
 457     /***
 458      * Cf. overriden method documentation.
 459      *
@@ -491,7 +491,7 @@
 463     {
 464         return "jxr";
 465     }
-466 
+466
 467     /***
 468      * Returns the correct resource bundle according to the locale
 469      *
@@ -503,7 +503,7 @@
 475     {
 476         return ResourceBundle.getBundle( "jxr-report", locale, this.getClass().getClassLoader() );
 477     }
-478 
+478
 479 }