如果在<stylesheetfile/>参数中未指定自定义样式表,则<stylesheet/>参数将指示将使用哪个样式表——maven javadoc 插件中包含的样式表或 javadoc 工具使用的默认样式表。maven值表示 maven javadoc 插件样式表,而java值表示默认的 javadoc 工具样式表。如果未指定,则默认为java值。
<project> ... <reporting> (or <build>) <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>3.3.2</version> <configuration> <stylesheet>maven</stylesheet> ... </configuration> </plugin> </plugins> ... </reporting> (or </build>) ... </project>
如果指定了自定义<stylesheetfile/>参数,您将能够使用它:
<project> ... <reporting> (or <build>) <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>3.3.2</version> <configuration> <stylesheetfile>${basedir}/path/to/your/stylesheetfile.css</stylesheetfile> ... </configuration> </plugin> </plugins> ... </reporting> (or </build>) ... </project>
<project> ... <reporting> (or <build>) <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>3.3.2</version> <configuration> <stylesheetfile>path/to/your/stylesheet.css</stylesheetfile> ... </configuration> </plugin> </plugins> ... </reporting> (or </build>) ... </project>
<project> ... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>3.3.2</version> <configuration> <stylesheetfile>path/to/your/stylesheet.css</stylesheetfile> </configuration> <dependencies> <dependency> <groupId>groupId</groupId> <artifactId>artifactId</artifactId> <version>version</version> </dependency> </dependencies> </plugin> </plugins> ... </build> ... </project>