Killing Javadoc warnings for specific tags

半世苍凉 提交于 2019-12-05 12:43:05

问题


Is there an easy way / option of preventing javadoc warnings when building with Maven? We use the soyatec uml plugin for eclipse and it inserts special tags which make our builds throw lots of annoying warnings; I've looked around including on the soyatec site and have come up empty.

@uml.property is an unknown tag

回答1:


The only answer I could find to this is by Configuring Custom Javadoc Tags.

An example could be like this:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8.1</version>
            <configuration>
                <tags>
                    <tag>
                        <name>uml.property</name>
                        <!-- The value X makes javadoc ignoring the tag -->
                        <placement>X</placement>
                    </tag>
                    <tag>
                        <name>some.other.property</name>
                        <placement>X</placement>
                    </tag>
                    <tag>
                        <name>some.third.property</name>
                        <placement>X</placement>
                    </tag>
                </tags>
            </configuration>
        </plugin>
    </plugins>
</build>

When running you will see this in the output:

mvn javadoc:javadoc

<lots of output>
Note: Custom tags that were not seen:  @uml.property
<maybe more output>

And you can disable non-error and non-warning messages by using this command:

mvn javadoc:javadoc -Dquiet

It might be a hard job to define all these tags but once done you will no longer see the warnings.

And you should probably define these custom tags in a parent pom that everyone can use to benefit all the work.



来源:https://stackoverflow.com/questions/12591175/killing-javadoc-warnings-for-specific-tags

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!