Killing Javadoc warnings for specific tags

前端 未结 1 1791
离开以前
离开以前 2021-02-19 09:46

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 build

相关标签:
1条回答
  • 2021-02-19 10:10

    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.

    0 讨论(0)
提交回复
热议问题