maven-javadoc-plugin 中断 mvn 发布:执行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25983852/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
maven-javadoc-plugin breaks mvn release:perform
提问by Rob Johansen
I'm trying to execute mvn release:perform
on three projects that I have released to our Nexus server manytimes in the past. Suddenly today, for no apparent reason, all releases are failing to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10:jar (attach-javadocs)
.
我想执行mvn release:perform
的三个项目,我已经发布到我们的Nexus服务器众多,在过去的时间。今天突然,无缘无故,所有版本都没有执行目标org.apache.maven.plugins:maven-javadoc-plugin:2.10:jar (attach-javadocs)
。
With full stack tracing and debug logging turned on (-e
and -X
), I see several hundred lines of errors about missing packages:
启用完整堆栈跟踪和调试日志记录(-e
和-X
)后,我看到数百行关于丢失包的错误:
...
package org.apache.http does not exist
package org.slf4j does not exist
package org.joda.time does not exist
...
However, all of these packages are in both my local repository and Nexus server. Moreover, I don't get any of these errors from mvn clean install
, and all the projects (Java web apps) actually launch from Intellij without issues—so clearly I'm not actually missing hundreds of packages.
但是,所有这些包都在我的本地存储库和 Nexus 服务器中。此外,我没有从 中得到任何这些错误mvn clean install
,并且所有项目(Java Web 应用程序)实际上从 Intellij 启动都没有问题——所以很明显,我实际上并没有遗漏数百个包。
What could be preventing mvn release:perform
from finding these packages when mvn clean install
and mvn release:prepare
don't have any problems?
mvn release:perform
当没有任何问题时mvn clean install
,什么可能阻止找到这些包mvn release:prepare
?
采纳答案by David J. Liszewski
There seems to be a cascade of issues regarding update to maven-javadoc-plugin
. See https://issues.apache.org/jira/browse/MJAVADOC-408.
似乎有一系列关于更新到maven-javadoc-plugin
. 请参阅https://issues.apache.org/jira/browse/MJAVADOC-408。
I can see some benefit in having mvn
use the latest versions of "built-in" plugins if not otherwise specified (vs. a "pinned version" for a given Maven version), but it means plug-in maintainers are obliged to do regression testing against every version of Maven upon a plugin release. Maybe something was missed.
mvn
如果没有另外指定,我可以看到使用最新版本的“内置”插件的一些好处(相对于给定 Maven 版本的“固定版本”),但这意味着插件维护者有义务进行回归测试在插件发布时针对每个版本的 Maven。也许错过了什么。
One workaround would be to explicitly specify the previous version of maven-javadoc-plugin
in your organization's super POM, or alternatively, the project POM if it's not possible to change the super POM in a hurry:
一种解决方法是maven-javadoc-plugin
在您组织的超级 POM 中明确指定以前的版本,或者如果无法紧急更改超级 POM,则指定项目 POM:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
</plugin>
</plugins>
</pluginManagement>
Our CI rig (Jenkins) hit the same problem today. Hopefully a new maven-javadoc-plugin
will get pushed with it's dependency tree updated (if that is indeed the issue). FWIW, we were on 3.0.5 (ya, sad for a variety of reasons).
我们的 CI 装备 (Jenkins) 今天遇到了同样的问题。希望一个新的maven-javadoc-plugin
会随着它的依赖树更新而被推送(如果这确实是问题所在)。FWIW,我们在 3.0.5(是的,由于各种原因而悲伤)。
Update 2014-09-24
更新 2014-09-24
This whole hubub seems to have originated in the response of maven-javadoc-plugin
maintainers to an yet-to-be-closed issuein java-1.8.0-openjdk
in MJAVADOC-398. I have no idea why anyone would release a breaking work-around for a unresolved downstream project defect.
这整个hubub似乎起源于响应maven-javadoc-plugin
维护者一个尚未将要关闭的问题在java-1.8.0-openjdk
中MJAVADOC-398。我不知道为什么有人会针对未解决的下游项目缺陷发布破坏性的解决方法。
Update 2014-10-02
更新 2014-10-02
MJAVADOC-406has been resolved and there is a 2.10.1
version of maven-javadoc-plugin
available in Maven Central and likely many repositories near you.
MJAVADOC-406已得到解决,并且在 Maven Central 和您附近的许多存储库中都有一个可用2.10.1
版本maven-javadoc-plugin
。
Builds with un-pinned javadoc plugin version should be returning to normal now.
使用未固定的 javadoc 插件版本构建现在应该恢复正常。
Moral of the Story
故事的道德启示
Maven-folk, you have been warned. Lock down your plug-in dependencies because they could go rogue.
Maven-folk,你已经被警告过。锁定您的插件依赖项,因为它们可能会变得流氓。
P.S., MJAVADOC-408has been closed as a duplicate of MJAVADOC-407.
PS,MJAVADOC-408已作为MJAVADOC-407的副本关闭。
回答by Frédéric Meunier
Another way to fix this issue is to add the following property :
解决此问题的另一种方法是添加以下属性:
...
<properties>
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
...
</properties>
in your pom.xml
在你的 pom.xml
回答by user2800708
I just had a previously working build fail with Javadoc plugin 2.9.1.
我之前使用 Javadoc 插件 2.9.1 进行的构建失败。
In my case it was because I switched to Java 8 from 7, and the javadoc tool in 8 seems to be stricter with its checks. I had a broken {@link ...}
in my code that the tool from 7 was letting through.
就我而言,这是因为我从 7 切换到 Java 8,而 8 中的 javadoc 工具似乎对其检查更严格。我有一个坏{@link ...}
在我的代码,从7的工具是让通过。
回答by user1948559
I have version 2.8 and
我有 2.8 版和
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
works
作品
回答by magiccrafter
If javadocs generation is not needed just add the skip property:
如果不需要生成 javadoc,只需添加 skip 属性:
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
回答by crandrad
mvn release package uses a special profile by default. This default profile includes some default plugin configurations (such as automatically attach-javadocs as part of the build).
mvn 发布包默认使用一个特殊的配置文件。此默认配置文件包括一些默认插件配置(例如作为构建的一部分自动附加 javadocs)。
This is the reason your build is only failing on mvn release:perform
and not on mvn clean install
.
这就是您的构建仅失败mvn release:perform
而不是的原因mvn clean install
。
If you want to control in a better way what configuration is going to be used (for example if you don't want javadocs, or you want to provide your own configuration for the javadocs), you can try disabling this default profile by adding the configuration:
<useReleaseProfile>false</useReleaseProfile>
如果您想以更好的方式控制将要使用的配置(例如,如果您不想要 javadoc,或者您想为 javadoc 提供您自己的配置),您可以尝试通过添加配置:
<useReleaseProfile>false</useReleaseProfile>
or in the command-line:
mvn release:perform -DuseReleaseProfile=false
或在命令行中:
mvn release:perform -DuseReleaseProfile=false
More info here: http://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html#useReleaseProfile
更多信息:http: //maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html#useReleaseProfile