[MENFORCER-106] @threadSafe
git-svn-id: https://svn.apache.org/repos/asf/maven/enforcer/trunk@1127643 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/DisplayInfoMojo.java b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/DisplayInfoMojo.java
index 298c92f..9ef7b32 100644
--- a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/DisplayInfoMojo.java
+++ b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/DisplayInfoMojo.java
@@ -35,10 +35,11 @@
/**
* This goal displays the current platform information.
- *
+ *
* @goal display-info
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
+ * @threadSafe
*/
public class DisplayInfoMojo
extends AbstractMojo
@@ -47,14 +48,14 @@
/**
* Path Translator needed by the ExpressionEvaluator
- *
+ *
* @component role="org.apache.maven.project.path.PathTranslator"
*/
protected PathTranslator translator;
/**
* The MavenSession
- *
+ *
* @parameter default-value="${session}"
* @readonly
*/
@@ -62,7 +63,7 @@
/**
* POM
- *
+ *
* @parameter default-value="${project}"
* @readonly
* @required
diff --git a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
index e13d943..18ecc78 100644
--- a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
+++ b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
@@ -45,6 +45,7 @@
* @requiresDependencyResolution test
* @goal enforce
* @phase validate
+ * @threadSafe
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
*/
@@ -183,7 +184,11 @@
if ( ignoreCache || shouldExecute( rule ) )
{
// execute the rule
- rules[i].execute( helper );
+ //noinspection SynchronizationOnLocalVariableOrMethodParameter
+ synchronized ( rule )
+ {
+ rule.execute( helper );
+ }
}
}
catch ( EnforcerRuleException e )
diff --git a/pom.xml b/pom.xml
index 6f64c1b..2c4c0d2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -152,7 +152,7 @@
</distributionManagement>
<properties>
<maven.version>2.0.9</maven.version>
- <maven.plugin.plugin.version>2.5.1</maven.plugin.plugin.version>
+ <maven.plugin.plugin.version>2.7</maven.plugin.plugin.version>
<site.deploy.url>scp://people.apache.org/www/maven.apache.org</site.deploy.url>
</properties>