mvn release:在java 8中执行失败 - 添加了javadoc插件

时间:2015-12-18 11:15:42

标签: java maven java-8 javadoc release

我在运行发布时遇到问题:使用Java 8和maven 3.0.5执行。生成Javadoc时出错。我添加了javadoc插件:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <executions>
        <execution>
            <id>attach-javadocs</id>
            <goals>
                <goal>jar</goal>
            </goals>
            <configuration>
               <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
        </execution>
    </executions>
</plugin>

奇怪的是,当我运行'mvn javadoc:javadoc'或'mvn javadoc:jar'时,它工作正常。有人有解决方法吗?

生成所有内容后,我收到此错误:

Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (attach-javadocs) on project sdm: MavenReportException: Error while generating Javadoc:
[INFO] [ERROR] C:\dir...\JavaClass.java:50: error: self-closing element not allowed
[INFO] [ERROR] * <p/>
[INFO] [ERROR] ^
[INFO] [ERROR]
[INFO] [ERROR] Command line was: "C:\Program Files\Java\jdk1.8.0_60\jre\..\bin\javadoc.exe" @options @packages
[INFO] [ERROR]
[INFO] [ERROR] Refer to the generated Javadoc files in 'C:\dir.....\' dir.

2 个答案:

答案 0 :(得分:4)

尝试完全禁用java 8的文档linting:

<profile>
    <id>disable-javadoc-doclint</id>
    <activation>
        <jdk>[1.8,)</jdk>
    </activation>
    <properties>
        <additionalparam>-Xdoclint:none</additionalparam>
    </properties>
</profile>

在此处找到:https://issues.shibboleth.net/jira/browse/JPAR-73

答案 1 :(得分:0)

不幸的是;我无法通过提供的信息告诉您为什么“-Xdoclint:none”不受发布插件的尊重。

但是一个“简单”修复可能只是完全删除参数并实际修复Javadoc问题编译器报告(例如不允许的自闭元素)。