Maven:发现以元素 "reportSets" 开头的无效内容

Maven: Invalid content was found starting with element "reportSets"

这是pom.xml中的javadoc插件:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.10.4</version>
    <reportSets>
        <reportSet>
            <id>PDF</id>
            <reports>
                <report>javadoc</report>
            </reports>
            <configuration>
                <name>PDF</name>
                <description>MovieList documentation</description>
                <destDir>pdf</destDir>
                <doclet>com.tarsec.javadoc.pdfdoclet.PDFDoclet</doclet>
                <docletPath>lib\pdfdoclet-1.0.3-all.jar</docletPath>
                <useStandardDocletOptions>false</useStandardDocletOptions>
                <additionalparam>
                    -pdf javadoc.pdf
                </additionalparam>
            </configuration>
        </reportSet>
    </reportSets>
</plugin>

它在 <reportSets> 上有错误。

它说 Invalid content was found starting with element 'reportSets'

我正在尝试将它与 PDFDoclet jar 一起使用,但我无法让它工作。我做错了什么?

也许可以使用他们网站上的示例。

<ant:javadoc doclet="com.tarsec.javadoc.pdfdoclet.PDFDoclet"
        docletpath="./jar/pdfdoclet-1.0.0-all.jar"
        packagenames="com.jlaby.*"
        overview="./example/laby/overview_laby.html"
        additionalparam="-pdf ./example/results/laby.pdf -config ./example/laby/config_laby.properties"
        private="no"
        sourcepath="./example/laby" >
</ant:javadoc>

http://pdfdoclet.sourceforge.net/running.html

我不确定,但可能您没有将 plugin 放在正确的元素中。 这应该在 <reporting> 元素中。它应该看起来像:

<?xml version="1.0" encoding="ISO-8859-1"?>
<project ...>
...
    <reporting>
    ...
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <reportSets>
                    <reportSet>
                        <id>PDF</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                        <configuration>
                            <name>PDF</name>
                            <description>MovieList documentation</description>
                            <destDir>pdf</destDir>
                            <doclet>com.tarsec.javadoc.pdfdoclet.PDFDoclet</doclet>
                            <docletPath>lib\pdfdoclet-1.0.3-all.jar</docletPath>
                            <useStandardDocletOptions>false</useStandardDocletOptions>
                            <additionalparam>
                                -pdf javadoc.pdf
                            </additionalparam>
                        </configuration>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    ...
    </reporting>
 ...
</project>

如果您将此部分放在例如您收到的错误消息与您收到的完全一样 - Invalid content was found starting with element 'reportSets'