Skip to content

Commit 0e65561

Browse files
Cleanups legacy tags option from code and documentations
Fix #98
1 parent 15a9ba8 commit 0e65561

19 files changed

+262
-90
lines changed

src/main/java/org/codehaus/mojo/taglist/TagListReport.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ public class TagListReport extends AbstractMavenReport {
190190
@Parameter
191191
private org.codehaus.mojo.taglist.options.TagListOptions tagListOptions;
192192

193-
private String[] tags;
194-
195193
/**
196194
* Skip generating report if no tags found in sources.
197195
*
@@ -262,14 +260,6 @@ private void executeAnalysis() {
262260
// Create the tag classes
263261
List<TagClass> tagClasses = new ArrayList<>();
264262

265-
// If any old style tags were used, then add each tag as a tag class
266-
if (tags != null && tags.length > 0) {
267-
getLog().warn("Using legacy tag format. This is not recommended.");
268-
for (String tag : tags) {
269-
tagClasses.add(createTagClass(tag));
270-
}
271-
}
272-
273263
// If the new style of tag options were used, add them
274264
if (tagListOptions != null && !tagListOptions.getTagClasses().isEmpty()) {
275265
// Scan each tag class

src/site/apt/usage.apt.vm

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,4 @@ mvn site
8888
</reporting>
8989
...
9090
</project>
91-
+---+
92-
93-
For backwards compatibility with versions prior to the 2.4 release, the legacy tags configuration is supported;
94-
however, only exact matching
95-
is used with legacy configuration.
96-
97-
+---+
98-
99-
<project>
100-
...
101-
<configuration>
102-
<tags>
103-
<tag>TODO</tag>
104-
<tag>FIXME</tag>
105-
<tag>@todo</tag>
106-
<tag>@deprecated</tag>
107-
</tags>
108-
</configuration>
109-
...
110-
</project>
11191
+---+

src/test/resources/unit/basic-config-test/colons-pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@
3535
<configuration>
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
38-
<tags>
39-
<tag>@colons</tag>
40-
</tags>
38+
<tagListOptions>
39+
<tagClasses>
40+
<tagClass>
41+
<displayName>@colons</displayName>
42+
<tags>
43+
<tag>
44+
<matchString>@colons</matchString>
45+
</tag>
46+
</tags>
47+
</tagClass>
48+
</tagClasses>
49+
</tagListOptions>
4150
</configuration>
4251
</plugin>
4352
</plugins>

src/test/resources/unit/basic-config-test/create-output-pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@
3535
<configuration>
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
38-
<tags>
39-
<tag>@create_output</tag>
40-
</tags>
38+
<tagListOptions>
39+
<tagClasses>
40+
<tagClass>
41+
<displayName>@create_output</displayName>
42+
<tags>
43+
<tag>
44+
<matchString>@create_output</matchString>
45+
</tag>
46+
</tags>
47+
</tagClass>
48+
</tagClasses>
49+
</tagListOptions>
4150
</configuration>
4251
</plugin>
4352
</plugins>

src/test/resources/unit/basic-config-test/empty-colons-pom.xml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,26 @@
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
3838
<emptyComments>true</emptyComments>
39-
<tags>
40-
<tag>@empty_no_colons</tag>
41-
<tag>@empty_colons</tag>
42-
</tags>
39+
<tagListOptions>
40+
<tagClasses>
41+
<tagClass>
42+
<displayName>@empty_no_colons</displayName>
43+
<tags>
44+
<tag>
45+
<matchString>@empty_no_colons</matchString>
46+
</tag>
47+
</tags>
48+
</tagClass>
49+
<tagClass>
50+
<displayName>@empty_colons</displayName>
51+
<tags>
52+
<tag>
53+
<matchString>@empty_colons</matchString>
54+
</tag>
55+
</tags>
56+
</tagClass>
57+
</tagClasses>
58+
</tagListOptions>
4359
</configuration>
4460
</plugin>
4561
</plugins>

src/test/resources/unit/basic-config-test/empty-comments-disabled-pom.xml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@
3333
<plugin>
3434
<artifactId>taglist-maven-plugin</artifactId>
3535
<configuration>
36-
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
36+
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub" />
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory-empty-comments-disabled</outputDirectory>
3838
<skipEmptyReport>true</skipEmptyReport>
3939
<emptyComments>false</emptyComments>
40-
<tags>
41-
<tag>@empty_comment</tag>
42-
</tags>
40+
<tagListOptions>
41+
<tagClasses>
42+
<tagClass>
43+
<displayName>@empty_comment</displayName>
44+
<tags>
45+
<tag>
46+
<matchString>@empty_comment</matchString>
47+
</tag>
48+
</tags>
49+
</tagClass>
50+
</tagClasses>
51+
</tagListOptions>
4352
</configuration>
4453
</plugin>
4554
</plugins>

src/test/resources/unit/basic-config-test/empty-comments-enabled-pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,18 @@
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
3838
<emptyComments>true</emptyComments>
39-
<tags>
40-
<tag>@empty_comment</tag>
41-
</tags>
39+
<tagListOptions>
40+
<tagClasses>
41+
<tagClass>
42+
<displayName>@empty_comment</displayName>
43+
<tags>
44+
<tag>
45+
<matchString>@empty_comment</matchString>
46+
</tag>
47+
</tags>
48+
</tagClass>
49+
</tagClasses>
50+
</tagListOptions>
4251
</configuration>
4352
</plugin>
4453
</plugins>

src/test/resources/unit/basic-config-test/multiple-line-comments-disabled-pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,18 @@
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
3838
<multipleLineComments>false</multipleLineComments>
39-
<tags>
40-
<tag>@multiple_line_comment</tag>
41-
</tags>
39+
<tagListOptions>
40+
<tagClasses>
41+
<tagClass>
42+
<displayName>@multiple_line_comment</displayName>
43+
<tags>
44+
<tag>
45+
<matchString>@multiple_line_comment</matchString>
46+
</tag>
47+
</tags>
48+
</tagClass>
49+
</tagClasses>
50+
</tagListOptions>
4251
</configuration>
4352
</plugin>
4453
</plugins>

src/test/resources/unit/basic-config-test/multiple-line-comments-enabled-pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,18 @@
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
3838
<multipleLineComments>true</multipleLineComments>
39-
<tags>
40-
<tag>@multiple_line_comment</tag>
41-
</tags>
39+
<tagListOptions>
40+
<tagClasses>
41+
<tagClass>
42+
<displayName>@multiple_line_comment</displayName>
43+
<tags>
44+
<tag>
45+
<matchString>@multiple_line_comment</matchString>
46+
</tag>
47+
</tags>
48+
</tagClass>
49+
</tagClasses>
50+
</tagListOptions>
4251
</configuration>
4352
</plugin>
4453
</plugins>

src/test/resources/unit/basic-config-test/show-empty-details-disabled-pom.xml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,26 @@
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
3838
<showEmptyDetails>false</showEmptyDetails>
39-
<tags>
40-
<tag>@show_empty_details_tag_in_code</tag>
41-
<tag>@show_empty_details_tag_not_in_code</tag>
42-
</tags>
39+
<tagListOptions>
40+
<tagClasses>
41+
<tagClass>
42+
<displayName>@show_empty_details_tag_in_code</displayName>
43+
<tags>
44+
<tag>
45+
<matchString>@show_empty_details_tag_in_code</matchString>
46+
</tag>
47+
</tags>
48+
</tagClass>
49+
<tagClass>
50+
<displayName>@show_empty_details_tag_not_in_code</displayName>
51+
<tags>
52+
<tag>
53+
<matchString>@show_empty_details_tag_not_in_code</matchString>
54+
</tag>
55+
</tags>
56+
</tagClass>
57+
</tagClasses>
58+
</tagListOptions>
4359
</configuration>
4460
</plugin>
4561
</plugins>

src/test/resources/unit/basic-config-test/show-empty-details-enabled-pom.xml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,26 @@
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
3838
<showEmptyDetails>true</showEmptyDetails>
39-
<tags>
40-
<tag>@show_empty_details_tag_in_code</tag>
41-
<tag>@show_empty_details_tag_not_in_code</tag>
42-
</tags>
39+
<tagListOptions>
40+
<tagClasses>
41+
<tagClass>
42+
<displayName>@show_empty_details_tag_in_code</displayName>
43+
<tags>
44+
<tag>
45+
<matchString>@show_empty_details_tag_in_code</matchString>
46+
</tag>
47+
</tags>
48+
</tagClass>
49+
<tagClass>
50+
<displayName>@show_empty_details_tag_not_in_code</displayName>
51+
<tags>
52+
<tag>
53+
<matchString>@show_empty_details_tag_not_in_code</matchString>
54+
</tag>
55+
</tags>
56+
</tagClass>
57+
</tagClasses>
58+
</tagListOptions>
4359
</configuration>
4460
</plugin>
4561
</plugins>

src/test/resources/unit/basic-config-test/xml-output-pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,18 @@
3636
<project implementation="org.codehaus.mojo.taglist.stubs.BasicConfigProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/basic-config-test/outputDirectory</outputDirectory>
3838
<showEmptyDetails>false</showEmptyDetails>
39-
<tags>
40-
<tag>@create_output</tag>
41-
</tags>
39+
<tagListOptions>
40+
<tagClasses>
41+
<tagClass>
42+
<displayName>@create_output</displayName>
43+
<tags>
44+
<tag>
45+
<matchString>@create_output</matchString>
46+
</tag>
47+
</tags>
48+
</tagClass>
49+
</tagClasses>
50+
</tagListOptions>
4251
</configuration>
4352
</plugin>
4453
</plugins>

src/test/resources/unit/counting-tags-test/counting-tags-pom.xml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,52 @@
3333
<plugin>
3434
<artifactId>taglist-maven-plugin</artifactId>
3535
<configuration>
36-
<project implementation="org.codehaus.mojo.taglist.stubs.CountingTagsProjectStub"/>
36+
<project implementation="org.codehaus.mojo.taglist.stubs.CountingTagsProjectStub" />
3737
<outputDirectory>${basedir}/target/test-classes/unit/counting-tags-test/outputDirectory</outputDirectory>
38-
<tags>
39-
<tag>TODO</tag>
40-
<tag>&lt;todo</tag>
41-
<tag>FIXME</tag>
42-
<tag>DOCUMENT_ME</tag>
43-
<tag>NOT_YET_DOCUMENTED</tag>
44-
</tags>
38+
<tagListOptions>
39+
<tagClasses>
40+
<tagClass>
41+
<displayName>TODO</displayName>
42+
<tags>
43+
<tag>
44+
<matchString>TODO</matchString>
45+
</tag>
46+
</tags>
47+
</tagClass>
48+
<tagClass>>
49+
<displayName>&lt;todo</displayName>
50+
<tags>
51+
<tag>
52+
<matchString>&lt;todo</matchString>
53+
</tag>
54+
</tags>
55+
</tagClass>
56+
<tagClass>
57+
<displayName>FIXME</displayName>
58+
<tags>
59+
<tag>
60+
<matchString>FIXME</matchString>
61+
</tag>
62+
</tags>
63+
</tagClass>
64+
<tagClass>
65+
<displayName>DOCUMENT_ME</displayName>
66+
<tags>
67+
<tag>
68+
<matchString>DOCUMENT_ME</matchString>
69+
</tag>
70+
</tags>
71+
</tagClass>
72+
<tagClass>
73+
<displayName>NOT_YET_DOCUMENTED</displayName>
74+
<tags>
75+
<tag>
76+
<matchString>NOT_YET_DOCUMENTED</matchString>
77+
</tag>
78+
</tags>
79+
</tagClass>
80+
</tagClasses>
81+
</tagListOptions>
4582
</configuration>
4683
</plugin>
4784
</plugins>

src/test/resources/unit/tag-test/c-style-tags-pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@
3535
<configuration>
3636
<project implementation="org.codehaus.mojo.taglist.stubs.TagsProjectStub"/>
3737
<outputDirectory>${basedir}/target/test-classes/unit/tag-test/outputDirectory</outputDirectory>
38-
<tags>
39-
<tag>c_style_tag</tag>
40-
</tags>
38+
<tagListOptions>
39+
<tagClasses>
40+
<tagClass>
41+
<displayName>c_style_tag</displayName>
42+
<tags>
43+
<tag>
44+
<matchString>c_style_tag</matchString>
45+
</tag>
46+
</tags>
47+
</tagClass>
48+
</tagClasses>
49+
</tagListOptions>
4150
</configuration>
4251
</plugin>
4352
</plugins>

0 commit comments

Comments
 (0)