Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mark maven plugin threadSafe

Tags:

maven-3

I want to mark maven-clean-plugin as threadsafe using @threadSafe annotation. could anybody give an example?

EDIT:

After I upgraded to maven 3.0.5, my build got below warnings: (building using 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] *****************************************************************

From the maven documentation, I too understand that clean plugin is thread safe. Even then, I get this warning. So, I thought I miss something somewhere.

like image 581
EmeraldTablet Avatar asked Oct 31 '25 01:10

EmeraldTablet


1 Answers

First why you are trying to use is an old style XDoclet annotation which is deprecated you should Java 5 annotations like this:

What would you like to do? The maven-clean-plugin is already thread safe. Which version of maven-clean-plugin do you use?

@Mojo( name = "WhatEver",
       threadSafe = true)
public class MyMojo
    extends AbstractMojo
like image 147
khmarbaise Avatar answered Nov 04 '25 04:11

khmarbaise



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!