28
28
29
29
Fixing Javadoc Comments
30
30
31
- When developers write code, they could forget to create (or update) the Javadoc comments. The <fix> and <test-fix>
31
+ When developers write code, they often forget to create (or update) the Javadoc comments. The <fix> and <test-fix>
32
32
goals are interactive goals (i.e. used generally in command line) to fix the actual Javadoc comments in your classes.
33
33
34
34
You need to call <mvn javadoc:fix> to fix main Java source files (i.e. inside src/main/java directory) or
35
35
<mvn javadoc:test-fix> to fix test Java source files (i.e. inside src/test/java directory).
36
36
37
- <<Important Note>>: Since the changes are done <<directly>> in the source code, we recommend <<strongly>> the use of
38
- a SCM, so you could always do a revert if a problem occurs. You could always add <<<-DoutputDirectory=/path/to/dir>>>
39
- to specify a target directory where classes will be generated.
37
+ <<Important Note>>: Since the changes are done <<directly>> in the source code by default , we <<strongly>> recommend using
38
+ a SCM, so you can revert if a problem occurs. You can also add <<<-DoutputDirectory=/path/to/dir>>>
39
+ to change the directory where classes will be generated and avoid overwriting the existing source code .
40
40
41
41
* Features Summary
42
42
43
- The user could skip the class/field/method Javadoc fixing using specific parameters, i.e.
43
+ The user can skip the class/field/method Javadoc fixing using specific parameters, i.e.
44
44
{{{../fix-mojo.html#fixClassComment}\<fixClassComment/\>}}.
45
- Also, the user could specify a {{{../fix-mojo.html#level}\<level/\>}}, i.e. public, to fix only class/field/method with
45
+ Also, the user can specify a {{{../fix-mojo.html#level}\<level/\>}}, i.e. public, to fix only class/field/method with
46
46
the given level.
47
47
48
- These goals could fix dynamically all Javadoc tags (by default, see {{{../fix-mojo.html#fixTags}\<fixTags/\>}}) or
49
- selective tags like author, version.. .
50
- Also, the user could specify default value for some tags, i.e. {{{../fix-mojo.html#defaultAuthor}\<defaultAuthor/\>}}.
48
+ These goals can fix all Javadoc tags (by default, see {{{../fix-mojo.html#fixTags}\<fixTags/\>}}) or
49
+ selective tags like author, version, etc .
50
+ You specify default value for some tags, for example, {{{../fix-mojo.html#defaultAuthor}\<defaultAuthor/\>}}.
51
51
52
- The <javadoc:fix> goal could use Clirr ({{{http://clirr.sourceforge.net}}} via the
53
- {{{http://mojo.codehaus.org/clirr-maven-plugin/}clirr-maven-plugin}}, a tool that checks Java libraries for
54
- binary and source compatibility with older releases. So, the <@since> tags will be dynamically added for the current
52
+ The <javadoc:fix> goal can use Clirr ({{{http://clirr.sourceforge.net}}} via the
53
+ {{{http://mojo.codehaus.org/clirr-maven-plugin/}clirr-maven-plugin}} to add
54
+ <@since> tags will be dynamically added for the current
55
55
project version. You need to add the <comparisonVersion> parameter (see below).
56
56
57
- Finally, the user could process specific Java files using the
57
+ Finally, the user can process specific Java files using the
58
58
{{{../fix-mojo.html#includes}includes}}/{{{../fix-mojo.html#excludes}excludes}} parameters.
59
59
60
60
** Current limitations
61
61
62
- The <fix> and <test-fix> goals use intensively {{{http ://qdox.codehaus.org/}Qdox }} to extract class/interface/method
63
- Javadoc from source files. Unfortunately, Qdox has {{{https://issues.apache.org/jira/browse/QDOX}some known issues}}.
62
+ The <fix> and <test-fix> goals use {{{https ://github.com/paul-hammant/qdox}qdox }} to extract class/interface/method
63
+ Javadoc from source files.
64
64
65
65
* Example Call
66
66
86
86
...
87
87
+-----+
88
88
89
- You could review the changes and commit.
89
+ You can then review the changes and commit.
90
90
91
91
* Using Clirr Integration
92
92
93
- <<Note>>: a previous artifact should be deployed firstly.
94
-
95
93
** Comparing against a specific version
96
94
97
- By default, the goals compare the current code against the latest released version, which is lower than the current
98
- version. If you want to use another version, you need to specify it similar to the Maven Clirr Plugin :
95
+ By default, the goals compare the current code against the latest released version which is lower than the current
96
+ version. If you want to use another version, you need to specify it like so :
99
97
100
98
+-----+
101
99
mvn javadoc:fix -DcomparisonVersion=1.0
@@ -107,9 +105,8 @@ mvn javadoc:fix -DcomparisonVersion=1.0
107
105
108
106
** Using another Clirr version
109
107
110
- By default, the <fix> and <test-fix> goals use the {{{http://mojo.codehaus.org/clirr-maven-plugin/}clirr-maven-plugin}},
111
- version <<<2.2.2>>>. To use another version, you need to add a dependency in the Javadoc plugin, similar to the
112
- following:
108
+ By default, the <fix> and <test-fix> goals use the {{{https://www.mojohaus.org/clirr-maven-plugin}clirr-maven-plugin}},
109
+ version <<<2.2.2>>>. To use another version, you need to add a dependency in the Javadoc plugin as shown here:
113
110
114
111
+-----+
115
112
<project>
0 commit comments