我在运行发布时遇到问题:使用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.
答案 0 :(得分:4)
尝试完全禁用java 8的文档linting:
<profile>
<id>disable-javadoc-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
答案 1 :(得分:0)
不幸的是;我无法通过提供的信息告诉您为什么“-Xdoclint:none”不受发布插件的尊重。
但是一个“简单”修复可能只是完全删除参数并实际修复Javadoc问题编译器报告(例如不允许的自闭元素)。