You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2021/05/01 12:06:35 UTC

[maven-javadoc-plugin] branch MJAVADOC-625 updated: Optimize code

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

rfscholte pushed a commit to branch MJAVADOC-625
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


The following commit(s) were added to refs/heads/MJAVADOC-625 by this push:
     new ade4a89  Optimize code
ade4a89 is described below

commit ade4a897f69fe1e28549e0ca40aeb1eed8bd4d6f
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat May 1 14:06:14 2021 +0200

    Optimize code
---
 .../maven/plugins/javadoc/AbstractJavadocMojo.java | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index ccad2e1..26a5a48 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -1426,21 +1426,14 @@ public abstract class AbstractJavadocMojo
     private String stylesheetfile;
     
     /**
-     * Specifies the path of an additional HTML stylesheet file.
-     * @since 3.1.2
-     */
-    @Parameter
-    private String addStylesheet;
-    
-    /**
-     * Specifies the path of an additional HTML stylesheet file.
+     * Specifies the path of an additional HTML stylesheet file relative to the {@link #javadocDirectory}
      * Example:
      * <pre>
      *     &lt;addStylesheets&gt;
-     *         &lt;src/main/javadoc/resources/addstylesheet.css&lt;/addStylesheet&gt;
+     *         &lt;resources/addstylesheet.css&lt;/addStylesheet&gt;
      *     &lt;/addStylesheets&gt;
      * </pre>
-     * @since 3.1.2
+     * @since 3.3.0
      */
     @Parameter
     private String[] addStylesheets;
@@ -3057,7 +3050,7 @@ public abstract class AbstractJavadocMojo
             return null;
         }
         
-        File addstylesheetfile = new File( stylesheet );
+        File addstylesheetfile = new File( getJavadocDirectory(), stylesheet );
         if ( addstylesheetfile.exists() )
         {
             String stylesheetfilename = getStylesheetFile( javadocOutputDirectory );
@@ -5557,14 +5550,13 @@ public abstract class AbstractJavadocMojo
         addArgIfNotEmpty( arguments, "-stylesheetfile",
                           JavadocUtil.quotedPathArgument( getStylesheetFile( javadocOutputDirectory ) ) );
         
-        addArgIfNotEmpty( arguments, "--add-stylesheet",
-                          JavadocUtil.quotedPathArgument( getAddStylesheet( javadocOutputDirectory, addStylesheet ) ) );
         if ( addStylesheets != null && addStylesheets.length != 0 )
         {
             for ( String as : addStylesheets )
             {
-                addArgIfNotEmpty( arguments, "--add-stylesheet",
-                        JavadocUtil.quotedPathArgument( getAddStylesheet( javadocOutputDirectory, as ) ) );
+                addArgIfNotEmpty( arguments, "--add-stylesheet",
+                                  JavadocUtil.quotedPathArgument( getAddStylesheet( javadocOutputDirectory, as ) ),
+                                  JavaVersion.parse( "10" ) );
             }
         }