How to change default javadoc stylesheet?

送分小仙女□ 提交于 2019-12-08 17:18:43

问题


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.


回答1:


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:

  • http://maven.apache.org/plugins/maven-javadoc-plugin/examples/stylesheet-configuration.html.

In case you are using ant, there is a way to inject the parameter to the javadoc tool:

  • http://ant.apache.org/manual/Tasks/javadoc.html

For more information, there are some discussion topics about that in stackoverflow: JavaDoc Style Sheets



来源:https://stackoverflow.com/questions/13614355/how-to-change-default-javadoc-stylesheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!