summaryrefslogtreecommitdiffstats
path: root/abi-check-plugin
diff options
context:
space:
mode:
authorIlpo Ruotsalainen <ilpo.ruotsalainen@verizonmedia.com>2019-02-11 13:31:45 +0100
committerIlpo Ruotsalainen <ilpo.ruotsalainen@verizonmedia.com>2019-02-11 13:31:45 +0100
commitb9cb350a697c895ad9fb71e2faae445abb7ef454 (patch)
treeb2377e619fd13832f0f2b31016844fafb2be7504 /abi-check-plugin
parent1f3d5bb43009736f3a1478cebecdc6e933ee7ea2 (diff)
Mark abi-check-plugin as thread safe.
Quick code review suggests this is okay as long as per-lookup instantiation strategy is used.
Diffstat (limited to 'abi-check-plugin')
-rw-r--r--abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java b/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java
index 2ee7bd495b3..a09e23bbe9e 100644
--- a/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java
+++ b/abi-check-plugin/src/main/java/com/yahoo/abicheck/mojo/AbiCheck.java
@@ -1,6 +1,5 @@
package com.yahoo.abicheck.mojo;
-import com.google.common.collect.Ordering;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
@@ -29,6 +28,7 @@ import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.InstantiationStrategy;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@@ -39,13 +39,16 @@ import org.objectweb.asm.ClassReader;
@Mojo(
name = "abicheck",
defaultPhase = LifecyclePhase.PACKAGE,
- requiresDependencyResolution = ResolutionScope.RUNTIME
+ requiresDependencyResolution = ResolutionScope.RUNTIME,
+ instantiationStrategy = InstantiationStrategy.PER_LOOKUP,
+ threadSafe = true
)
public class AbiCheck extends AbstractMojo {
public static final String PACKAGE_INFO_CLASS_FILE_NAME = "package-info.class";
private static final String DEFAULT_SPEC_FILE = "abi-spec.json";
private static final String WRITE_SPEC_PROPERTY = "abicheck.writeSpec";
+
@Parameter(defaultValue = "${project}", readonly = true)
private MavenProject project = null;