【发布时间】:2014-07-02 13:20:16
【问题描述】:
我想使用@threadSafe 注释将maven-clean-plugin 标记为线程安全。谁能举个例子?
编辑:
升级到 maven 3.0.5 后,我的构建收到以下警告:(使用 teamcity 构建)
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] *****************************************************************Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] * Your build is requesting parallel execution, but project *Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] * contains the following plugin(s) that are not marked as *Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] * @threadSafe to support parallel building. *Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] * While this /may/ work fine, please look for plugin updates *Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] * and/or request plugins be made thread-safe. *Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] * If reporting an issue, report it against the plugin in *Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] * question, not against maven-core *Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] *****************************************************************Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] The following plugins are not marked @threadSafe in STRAW Main Application:Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] org.apache.maven.plugins:maven-clean-plugin:2.3Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] org.apache.maven.plugins:maven-install-plugin:2.2Agent time: 14:21:10
[18:51:10][com.dir.hay.straw:straw-parent] [WARNING] *****************************************************************
从 maven 文档中,我也明白 clean 插件是线程安全的。即使那样,我也会收到这个警告。所以,我想我错过了什么地方。
【问题讨论】:
-
你想做什么? clean 插件已经是线程安全的 (maven.apache.org/plugins/maven-clean-plugin/clean-mojo.html)。您使用哪个版本的 maven-clean-plugin?
-
我没有仔细阅读。您正在使用极旧版本的插件 maven-clean-plugin 2.3、maven-install-plugin 2.2 等。您应该更新插件的定义。
标签: maven-3