简体   繁体   中英

Javadoc through Ant task with {@inheritDoc} from J2SE classes

I generate documentation for a project using an Ant task. In several places, I wanted to inherit documentation from the standard classes, so I used {@inheritDoc} which allowed me to see the Javadoc in Eclipse, but it wouldn't show up in the HTML files. The problem was that I hadn't included the unzipped src.zip (J2SE source) in the sourcepath. Having fixed that, I now get several hundred warnings about the use of Sun proprietary API in files like lib/jdk-src/java/lang/Class.java .

Is there any way to suppress these warnings? It's hard to find relevant problems in this mess.

A possible solution I thought of was to run the Javadoc task once without including the J2SE source in the sourcepath, which will reveal any real issues. Then I can run Javadoc a second time with the J2SE source included, discarding the output altogether, which will produce documentation with properly-working {@inheritDoc} s. I'm not entirely sure about the best way to accomplish this in Ant, not to mention that running Javadoc twice would be a dirty fix.

Any suggestions?

It's not the solution you're looking for, but you might try -link extdocURL . That way you'll at least get the "Overrides" or "Specified by" links for overridden or implemented methods, respectively. For developement libraries, the -linksource option is handy, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM