Is there a command line option to change the stylesheet file created by javadoc? I would like to use my own css file. The default blue one is boring. I tried a -stylesheet option, but it's not supported.
Asked
Active
Viewed 5,270 times
2 Answers
6
Yes, it's possible and actually quite straightforward. If you look for example at Mockito's javadoc:
- http://docs.mockito.googlecode.com/hg/org/mockito/Mockito.html (you can see that they have changed the default appereance just using this stylesheet)
If you are using Maven, you can do that by adding some config in the maven-javadoc-plugin:
In case you are using ant, there is a way to inject the parameter to the javadoc tool:
For more information, there are some discussion topics about that in stackoverflow: JavaDoc Style Sheets

Community
- 1
- 1

Markov Unchained
- 149
- 1
- 8
-
2Both links are dead! – AndiGeeky Dec 29 '16 at 11:42
0
For the maven-javadoc-plugin, you can also use:
<configuration>
<addStylesheets>our-stylesheet.css</addStylesheets>
</configuration>
which keeps the primary stylesheet, but then also adds the custom one, so that all you need to do is override the rules you want.
Put our-stylesheet.css
in the src/main/javadoc
directory.

Rob Stoecklein
- 749
- 6
- 9