jira-importer commented on issue #703:
URL: 
https://github.com/apache/maven-javadoc-plugin/issues/703#issuecomment-2957347093

   **[Vincent 
Zurczak](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=vzurczak)**
 commented
   
   Thank you for your answer.
   It is indeed possible to download a stylesheet with the ANT Maven plug-in 
and pass it to the Javadoc plug-in. I confess, I had not tried it. Here is a 
sample showing how to do this.
   
   ```xml
   <build>
        <plugins>
                <!-- Download the stylesheet for the javadoc -->
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                                <execution>
                                        <phase>generate-sources</phase>
                                        <configuration>
                                                
<exportAntProperties>true</exportAntProperties>
                                                <target>
                                                        <tempfile 
property="dir" destdir="${java.io.tmpdir}" />
                                                        <mkdir dir="${dir}" />
                                                        <property 
name="javadoc.stylesheet" value="${dir}/roboconf-javadoc.css" />
                                                        <get 
src="${build.resources.url}/javadoc/stylesheet.css" 
dest="${javadoc.stylesheet}" />
                                                </target>       
                                        </configuration>
                                        <goals>
                                                <goal>run</goal>
                                        </goals>
                                </execution>
                        </executions>
                </plugin>
   
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc.plugin.version}</version>
                        <executions>
                                <execution>
                                        <id>attach-javadoc</id>
                                        <goals>
                                                <goal>jar</goal>
                                        </goals>
                                        <configuration>
                                                
<stylesheetfile>${javadoc.stylesheet}</stylesheetfile>
                                        </configuration>
                                </execution>
                        </executions>
                </plugin>
        </plugins>
   </build>
   ```
   
   However, since this plug-in already supports to pick up a CSS file from a 
local file and from a Maven dependency, I though it would have been coherent to 
also be able to pick up the CSS file from an URL. That would avoid all the XML 
configuration I wrote above.
   
   With the patch I submitted, the configuration is reduced to...
   
   ```xml
   <build>
        <plugins>
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc.plugin.version}</version>
                        <executions>
                                <execution>
                                        <id>attach-javadoc</id>
                                        <goals>
                                                <goal>jar</goal>
                                        </goals>
                                        <configuration>
                                                
<stylesheetfile>${build.resources.url}/javadoc/stylesheet.css</stylesheetfile>
                                        </configuration>
                                </execution>
                        </executions>
                </plugin>
        </plugins>
   </build>
   ```
   
   I did not add a new mechanism in the plug-in, I only extended it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to