gpt4 book ai didi

maven-3 - 如何标记maven插件threadSafe

转载 作者:行者123 更新时间:2023-12-05 03:14:28 24 4
gpt4 key购买 nike

我想使用 @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 插件是线程安全的。即使那样,我也会收到此警告。所以,我想我错过了什么地方。

最佳答案

首先,您尝试使用的原因是旧式 XDoclet 注释,您应该弃用它 Java 5 annotations like this :

你想做什么? maven-clean-plugin is already thread safe .您使用哪个版本的 maven-clean-plugin?

@Mojo( name = "WhatEver",
threadSafe = true)
public class MyMojo
extends AbstractMojo

关于maven-3 - 如何标记maven插件threadSafe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24448623/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com