The javadocs library created by maven-javadoc-plugin does not work when connected to Eclipse

UPDATE1: These are not just parameter names, and eclipse does not display javadoc information at all. When you hover over a class, nothing is displayed.

UPDATE2: My version of eclipse is 4.2.0.

I use Eclipse, and I would like to attach the javadocs library to my project, so that when implementing the interface and selecting the "Add unrealized methods" option, the method parameter names are displayed correctly, not arg0, arg1, etc.

Problem:

  • When I create javadocs via eclipse (Project> Generate Javadocs ...) and associate it with my project , it works , in other words, I see the correct method parameter names.

  • When I create javadocs via maven-javadoc-plugin and link it to my project , it does not work , in other words, I see arg0, arg1, etc.

Perhaps I did not configure my maven-javadoc plugin correctly? Below is the configuration from my pom.xml:

<plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>2.8</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> 

Any help would be appreciated. Not seeing parameter names is very bad.

+5
source share
1 answer

This is due to this eclipse error , which was fixed only in version 4.3. Basically, an eclipse stops processing the javadoc html file in the following line:

 <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> 

as it expects the encoding in the content attribute as shown below:

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 

I don’t think there is a way to tell the maven javadoc plugin to change this meta tag, but you can run the ANT task below from maven to fix all your html files:

 <replace dir="target/apidocs"> <include name="**/*.html"/> <replacetoken><![CDATA[<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">]]></replacetoken> <replacevalue><![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">]]></replacevalue> </replace> 
+2
source

Source: https://habr.com/ru/post/1246562/


All Articles