1. 程式人生 > 實用技巧 >[Maven][taglist-maven-plugin]告警[WARNING] Using legacy tag format

[Maven][taglist-maven-plugin]告警[WARNING] Using legacy tag format

pom.xml中添加了taglist-maven-plugin配置,片段如下:

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>taglist-maven-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <tags>
                            <tag>fixme</tag>
                            <tag>FixMe</tag>
                            <tag>FIXME</tag>
                            <tag>@todo</tag>
                            <tag>todo</tag>
                            <tag>TODO</tag>
                            <tag>@deprecated</tag>
                        </tags>
                    </configuration>
                </plugin>

執行mvn clean package site時報錯[WARNING] Using legacy tag format. This is not recommended.,詳細報錯如下:

[INFO] Generating "Tag List" report      --- taglist-maven-plugin:2.4:taglist
[WARNING] Using legacy tag format.  This is not recommended.

這個WARNING指taglist-maven-plugin新版本指定tag的方式有所變更,新方式功能更強大,詳細資訊可以檢視:

http://jira.codehaus.org/browse/MTAGLIST-49。新版本的使用例項如下:

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>taglist-maven-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <tagListOptions>
                            <tagClasses>
                                <tagClass>
                                    <displayName>Todo Work Annotation</displayName>
                                    <tags>
                                        <tag>
                                            <matchString>TODO</matchString>
                                            <matchType>ignoreCase</matchType>
                                        </tag>
                                        <tag>
                                            <matchString>@todo</matchString>
                                            <matchType>ignoreCase</matchType>
                                        </tag>
                                        <tag>
                                            <matchString>FIXME</matchString>
                                            <matchType>exact</matchType>
                                        </tag>
                                    </tags>
                                </tagClass>
                                <tagClass>
                                    <displayName>Version Annotation</displayName>
                                    <tags>
                                        <tag>
                                            <matchString>@deprecated</matchString>
                                            <matchType>ignoreCase</matchType>
                                        </tag>
                                    </tags>
                                </tagClass>
                            </tagClasses>
                        </tagListOptions>
                    </configuration>
                </plugin>