Why do my generated Javadocs look awful?

I am trying to create javadoc html files for my project. I generate them through the Maven Javadoc plugin (maven-javadoc-plugin). I am using Maven 2.2.1. Everything is generated so that all the necessary information is there, but the HTML looks just awful. So bad that I donโ€™t want to publish it that way. Here is a screenshot:

( NOTE: Yes, I see that the message โ€œJavaScript is disabled in your browser.โ€ Even if I click on IE 8 a warning about active content and turn it on, it does not matter)

Screenshot of messed up Javadoc formatting

There are all kinds of unnecessary line breaks, and the basic formatting is just shit. Am I missing something? I expected to see Javadocs created that look similar to what I see in Eclipse if I hover over a class or method and see a Javadoc popup.

I tried adding the settings to my POM file, but I really don't know what I am doing when it comes to setting up the Javadoc generator. Here is what I have at the moment (inside the <reporting> element):

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9</version> <configuration> <javadocExecutable>C:\Java\jdk1.7.0_05\bin\javadoc.exe</javadocExecutable> <javadocVersion>1.7</javadocVersion> <locale>en_US</locale> <show>package</show> <verbose /> </configuration> </plugin> 

Any suggestions?


UPDATE:

The solution provided by Paulius worked perfectly. I deleted the section above from the <reporting> section, as it was completely unnecessary. I added a new <plugin> element as it is listed below. My POM file now contains this new block:

 <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.8.1</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> ... </plugins> </build> 

Here's what the fixed output looks like:

Properly generated javadoc

+7
source share
1 answer

Try removing the maven-javadoc-plugin section from reporting . If you are using Maven 3, the report section is outdated and should be deleted.

Try adding the following:

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.8.1</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> 

to the maven plugins section and run it. I use maven-javadoc-plugin like this and it generates regular javadocs.

Hope this helps.

+2
source

All Articles