这是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一起使用,但是我无法使其正常运行。我究竟做错了什么?

最佳答案

我不确定,但是可能您没有将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'

09-29 23:46