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 11:08:31 UTC

[maven-javadoc-plugin] branch MJAVADOC-625 created (now d6da313)

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

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


      at d6da313  Support for multiple stylesheets

This branch includes the following new commits:

     new c84548b  Support for multiple stylesheets
     new e9891bf  Support for multiple stylesheets
     new d6da313  Support for multiple stylesheets

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[maven-javadoc-plugin] 01/03: Support for multiple stylesheets

Posted by rf...@apache.org.
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

commit c84548b9bd5284a5c5d2accb9299d37ce915fb42
Author: Martin Schelldorfer <sc...@gmail.com>
AuthorDate: Thu Oct 17 15:16:28 2019 +0200

    Support for multiple stylesheets
---
 src/it/projects/MJAVADOC-625/invoker.properties    | 19 ++++++++
 src/it/projects/MJAVADOC-625/pom.xml               | 50 ++++++++++++++++++++++
 .../src/main/java/com/example/MJavaDoc625.java     | 28 ++++++++++++
 .../src/main/javadoc/resources/addstylesheet.css   | 23 ++++++++++
 src/it/projects/MJAVADOC-625/verify.groovy         | 24 +++++++++++
 .../maven/plugins/javadoc/AbstractJavadocMojo.java | 42 +++++++++++++++++-
 6 files changed, 184 insertions(+), 2 deletions(-)

diff --git a/src/it/projects/MJAVADOC-625/invoker.properties b/src/it/projects/MJAVADOC-625/invoker.properties
new file mode 100644
index 0000000..1258430
--- /dev/null
+++ b/src/it/projects/MJAVADOC-625/invoker.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.java.version = 10+
+invoker.goals=compile javadoc:javadoc
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-625/pom.xml b/src/it/projects/MJAVADOC-625/pom.xml
new file mode 100644
index 0000000..6e26644
--- /dev/null
+++ b/src/it/projects/MJAVADOC-625/pom.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+  <artifactId>mjavadoc-625</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-625</url>
+
+  <build>
+      <plugins>
+      	<plugin>
+	        <groupId>org.apache.maven.plugins</groupId>
+	        <artifactId>maven-compiler-plugin</artifactId>
+	        <version>3.8.0</version>
+	      </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          
+          <configuration>
+            <addStylesheet>src/main/javadoc/resources/addstylesheet.css</addStylesheet>
+          </configuration>
+        </plugin>
+      </plugins>
+  </build>
+  
+</project>
diff --git a/src/it/projects/MJAVADOC-625/src/main/java/com/example/MJavaDoc625.java b/src/it/projects/MJAVADOC-625/src/main/java/com/example/MJavaDoc625.java
new file mode 100644
index 0000000..163e444
--- /dev/null
+++ b/src/it/projects/MJAVADOC-625/src/main/java/com/example/MJavaDoc625.java
@@ -0,0 +1,28 @@
+package com.example;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * MJAVADOC-625 Support for multiple stylesheets
+ */
+public class MJavaDoc625
+{
+
+}
diff --git a/src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheet.css b/src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheet.css
new file mode 100644
index 0000000..02172e1
--- /dev/null
+++ b/src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheet.css
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+body
+{
+   font-size: 20px;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-625/verify.groovy b/src/it/projects/MJAVADOC-625/verify.groovy
new file mode 100644
index 0000000..05ca2c5
--- /dev/null
+++ b/src/it/projects/MJAVADOC-625/verify.groovy
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def file = new File( basedir, 'target/site/apidocs/com/example/MJavaDoc625.html' );
+
+assert file.exists()
+
+assert 1 == file.text.count('addstylesheet.css')
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 1409241..6d56a95 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -1423,8 +1423,14 @@ public abstract class AbstractJavadocMojo
      * stylesheetfile</a>.
      */
     @Parameter( property = "stylesheetfile" )
-   private String stylesheetfile;
-
+    private String stylesheetfile;
+    
+    /**
+     * Specifies the path of an additional HTML stylesheet file.
+     */
+    @Parameter
+    private String addStylesheet;
+    
     /**
      * Specifies the class file that starts the taglet used in generating the documentation for that tag.
      * <br/>
@@ -3028,6 +3034,35 @@ public abstract class AbstractJavadocMojo
 
         return getResource( new File( javadocOutputDirectory, DEFAULT_CSS_NAME ), stylesheetfile );
     }
+    
+    private String getAddStylesheet( final File javadocOutputDirectory )
+            throws MavenReportException
+    {
+        if ( StringUtils.isEmpty( addStylesheet ) )
+        {
+            return null;
+        }
+        
+        File addstylesheetfile = new File( addStylesheet );
+        if ( addstylesheetfile.exists() )
+        {
+            String stylesheet = getStylesheetFile( javadocOutputDirectory );
+            if ( stylesheet != null )
+            {
+                File stylesheetfile = new File( stylesheet );
+                if ( stylesheetfile.getName().equals( addstylesheetfile.getName() ) )
+                {
+                    throw new MavenReportException( "additional stylesheet must have a different name "
+                                                        + "than stylesheetfile: " + stylesheetfile.getName() );
+                }
+            }
+            
+            return addstylesheetfile.getAbsolutePath();
+        }
+
+        throw new MavenReportException( "additional stylesheet file does not exist: " 
+                                            + addstylesheetfile.getAbsolutePath() );
+    }
 
     /**
      * Method to get the help file to be used by the Javadoc Tool.
@@ -5507,6 +5542,9 @@ public abstract class AbstractJavadocMojo
 
         addArgIfNotEmpty( arguments, "-stylesheetfile",
                           JavadocUtil.quotedPathArgument( getStylesheetFile( javadocOutputDirectory ) ) );
+        
+        addArgIfNotEmpty( arguments, "--add-stylesheet",
+                          JavadocUtil.quotedPathArgument( getAddStylesheet( javadocOutputDirectory ) ) );
 
         if ( StringUtils.isNotEmpty( sourcepath ) && !isJavaDocVersionAtLeast( SINCE_JAVADOC_1_5 ) )
         {

[maven-javadoc-plugin] 03/03: Support for multiple stylesheets

Posted by rf...@apache.org.
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

commit d6da3138b7780aa93d561b193f33ec814ef2e6ff
Author: Martin Schelldorfer <sc...@gmail.com>
AuthorDate: Mon Oct 21 10:03:23 2019 +0200

    Support for multiple stylesheets
    
    (cherry picked from commit e669a49f0c6ea6d3fc966037a6a0bd6f6c82fc57)
---
 src/it/projects/MJAVADOC-625/pom.xml | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/it/projects/MJAVADOC-625/pom.xml b/src/it/projects/MJAVADOC-625/pom.xml
index ecf3b83..4216ad1 100644
--- a/src/it/projects/MJAVADOC-625/pom.xml
+++ b/src/it/projects/MJAVADOC-625/pom.xml
@@ -29,11 +29,9 @@
 				<version>3.8.0</version>
 			</plugin>
 			<plugin>
-				<!-- <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> 
-					<version>@project.version@</version> -->
-				<groupId>com.github.schelldorfer</groupId>
+				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>3.1.2</version>
+				<version>@project.version@</version>
 				<configuration>
 					<addStylesheet>src/main/javadoc/resources/addstylesheet.css</addStylesheet>
 					<addStylesheets>

[maven-javadoc-plugin] 02/03: Support for multiple stylesheets

Posted by rf...@apache.org.
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

commit e9891bf8c7fa15d54147f39cc2bd79d52ef55f4a
Author: Martin Schelldorfer <sc...@gmail.com>
AuthorDate: Mon Oct 21 09:55:51 2019 +0200

    Support for multiple stylesheets
    
    (cherry picked from commit 93390aa968a09e5a0f0e05998017967ccb7805ba)
---
 src/it/projects/MJAVADOC-625/pom.xml               | 84 +++++++++++-----------
 .../main/javadoc/resources/addstylesheets1.css}    | 13 ++--
 .../main/javadoc/resources/addstylesheets2.css}    | 13 ++--
 src/it/projects/MJAVADOC-625/verify.groovy         |  2 +
 .../maven/plugins/javadoc/AbstractJavadocMojo.java | 36 ++++++++--
 5 files changed, 84 insertions(+), 64 deletions(-)

diff --git a/src/it/projects/MJAVADOC-625/pom.xml b/src/it/projects/MJAVADOC-625/pom.xml
index 6e26644..ecf3b83 100644
--- a/src/it/projects/MJAVADOC-625/pom.xml
+++ b/src/it/projects/MJAVADOC-625/pom.xml
@@ -1,50 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
 
-  http://www.apache.org/licenses/LICENSE-2.0
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.apache.maven.plugins.javadoc.it</groupId>
+	<artifactId>mjavadoc-625</artifactId>
+	<version>1.0.0-SNAPSHOT</version>
 
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
+	<url>https://issues.apache.org/jira/browse/MJAVADOC-625</url>
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.maven.plugins.javadoc.it</groupId>
-  <artifactId>mjavadoc-625</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
-  
-  <url>https://issues.apache.org/jira/browse/MJAVADOC-625</url>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>3.8.0</version>
+			</plugin>
+			<plugin>
+				<!-- <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> 
+					<version>@project.version@</version> -->
+				<groupId>com.github.schelldorfer</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<version>3.1.2</version>
+				<configuration>
+					<addStylesheet>src/main/javadoc/resources/addstylesheet.css</addStylesheet>
+					<addStylesheets>
+						<addStylesheet>src/main/javadoc/resources/addstylesheets1.css</addStylesheet>
+						<addStylesheet>src/main/javadoc/resources/addstylesheets2.css</addStylesheet>
+					</addStylesheets>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 
-  <build>
-      <plugins>
-      	<plugin>
-	        <groupId>org.apache.maven.plugins</groupId>
-	        <artifactId>maven-compiler-plugin</artifactId>
-	        <version>3.8.0</version>
-	      </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-javadoc-plugin</artifactId>
-          <version>@project.version@</version>
-          
-          <configuration>
-            <addStylesheet>src/main/javadoc/resources/addstylesheet.css</addStylesheet>
-          </configuration>
-        </plugin>
-      </plugins>
-  </build>
-  
 </project>
diff --git a/src/it/projects/MJAVADOC-625/verify.groovy b/src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheets1.css
similarity index 83%
copy from src/it/projects/MJAVADOC-625/verify.groovy
copy to src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheets1.css
index 05ca2c5..5d34fde 100644
--- a/src/it/projects/MJAVADOC-625/verify.groovy
+++ b/src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheets1.css
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-def file = new File( basedir, 'target/site/apidocs/com/example/MJavaDoc625.html' );
-
-assert file.exists()
-
-assert 1 == file.text.count('addstylesheet.css')
+h1
+{
+   font-size: 26px;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-625/verify.groovy b/src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheets2.css
similarity index 83%
copy from src/it/projects/MJAVADOC-625/verify.groovy
copy to src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheets2.css
index 05ca2c5..cf005f5 100644
--- a/src/it/projects/MJAVADOC-625/verify.groovy
+++ b/src/it/projects/MJAVADOC-625/src/main/javadoc/resources/addstylesheets2.css
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * 
  *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-def file = new File( basedir, 'target/site/apidocs/com/example/MJavaDoc625.html' );
-
-assert file.exists()
-
-assert 1 == file.text.count('addstylesheet.css')
+h2
+{
+   font-size: 24px;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-625/verify.groovy b/src/it/projects/MJAVADOC-625/verify.groovy
index 05ca2c5..8cd0936 100644
--- a/src/it/projects/MJAVADOC-625/verify.groovy
+++ b/src/it/projects/MJAVADOC-625/verify.groovy
@@ -22,3 +22,5 @@ def file = new File( basedir, 'target/site/apidocs/com/example/MJavaDoc625.html'
 assert file.exists()
 
 assert 1 == file.text.count('addstylesheet.css')
+assert 1 == file.text.count('addstylesheets1.css')
+assert 1 == file.text.count('addstylesheets2.css')
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 6d56a95..ccad2e1 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -1427,10 +1427,24 @@ public abstract class AbstractJavadocMojo
     
     /**
      * 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.
+     * Example:
+     * <pre>
+     *     &lt;addStylesheets&gt;
+     *         &lt;src/main/javadoc/resources/addstylesheet.css&lt;/addStylesheet&gt;
+     *     &lt;/addStylesheets&gt;
+     * </pre>
+     * @since 3.1.2
+     */
+    @Parameter
+    private String[] addStylesheets;
+    
     /**
      * Specifies the class file that starts the taglet used in generating the documentation for that tag.
      * <br/>
@@ -3035,21 +3049,21 @@ public abstract class AbstractJavadocMojo
         return getResource( new File( javadocOutputDirectory, DEFAULT_CSS_NAME ), stylesheetfile );
     }
     
-    private String getAddStylesheet( final File javadocOutputDirectory )
+    private String getAddStylesheet( final File javadocOutputDirectory, final String stylesheet )
             throws MavenReportException
     {
-        if ( StringUtils.isEmpty( addStylesheet ) )
+        if ( StringUtils.isEmpty( stylesheet ) )
         {
             return null;
         }
         
-        File addstylesheetfile = new File( addStylesheet );
+        File addstylesheetfile = new File( stylesheet );
         if ( addstylesheetfile.exists() )
         {
-            String stylesheet = getStylesheetFile( javadocOutputDirectory );
-            if ( stylesheet != null )
+            String stylesheetfilename = getStylesheetFile( javadocOutputDirectory );
+            if ( stylesheetfilename != null )
             {
-                File stylesheetfile = new File( stylesheet );
+                File stylesheetfile = new File( stylesheetfilename );
                 if ( stylesheetfile.getName().equals( addstylesheetfile.getName() ) )
                 {
                     throw new MavenReportException( "additional stylesheet must have a different name "
@@ -5544,7 +5558,15 @@ public abstract class AbstractJavadocMojo
                           JavadocUtil.quotedPathArgument( getStylesheetFile( javadocOutputDirectory ) ) );
         
         addArgIfNotEmpty( arguments, "--add-stylesheet",
-                          JavadocUtil.quotedPathArgument( getAddStylesheet( javadocOutputDirectory ) ) );
+                          JavadocUtil.quotedPathArgument( getAddStylesheet( javadocOutputDirectory, addStylesheet ) ) );
+        if ( addStylesheets != null && addStylesheets.length != 0 )
+        {
+            for ( String as : addStylesheets )
+            {
+                addArgIfNotEmpty( arguments, "--add-stylesheet",
+                        JavadocUtil.quotedPathArgument( getAddStylesheet( javadocOutputDirectory, as ) ) );
+            }
+        }
 
         if ( StringUtils.isNotEmpty( sourcepath ) && !isJavaDocVersionAtLeast( SINCE_JAVADOC_1_5 ) )
         {