You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2024/09/30 15:47:29 UTC
(uima-uimaj) 01/01: Issue #398: Mark Maven plugins as thread-safe
This is an automated email from the ASF dual-hosted git repository.
rec pushed a commit to branch refactoring/398-Mark-Maven-plugins-as-thread-safe
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git
commit bcebe241ecfdcc116da4f3dcca3b0823097f88e4
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Mon Sep 30 17:47:19 2024 +0200
Issue #398: Mark Maven plugins as thread-safe
- Mark the plugins as thread-safe
---
.../src/main/java/org/apache/uima/pear/tools/PearPackagingMojo.java | 5 +++--
.../main/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojo.java | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/PearPackagingMavenPlugin/src/main/java/org/apache/uima/pear/tools/PearPackagingMojo.java b/PearPackagingMavenPlugin/src/main/java/org/apache/uima/pear/tools/PearPackagingMojo.java
index 5d5e7a144..0e0abb384 100644
--- a/PearPackagingMavenPlugin/src/main/java/org/apache/uima/pear/tools/PearPackagingMojo.java
+++ b/PearPackagingMavenPlugin/src/main/java/org/apache/uima/pear/tools/PearPackagingMojo.java
@@ -18,6 +18,8 @@
*/
package org.apache.uima.pear.tools;
+import static org.apache.maven.plugins.annotations.LifecyclePhase.PACKAGE;
+
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
@@ -30,7 +32,6 @@ import org.apache.commons.io.FileUtils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
@@ -42,7 +43,7 @@ import org.apache.uima.util.Level;
* UIMA nature is gathered and added to the PEAR package. Additionally the generated jar file from
* the Maven build is added with the according classpath information.
*/
-@Mojo(name = "package", defaultPhase = LifecyclePhase.PACKAGE)
+@Mojo(name = "package", defaultPhase = PACKAGE, threadSafe = true)
public class PearPackagingMojo extends AbstractMojo {
/**
diff --git a/jcasgen-maven-plugin/src/main/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojo.java b/jcasgen-maven-plugin/src/main/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojo.java
index 753ea1a65..ed8b209b0 100644
--- a/jcasgen-maven-plugin/src/main/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojo.java
+++ b/jcasgen-maven-plugin/src/main/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojo.java
@@ -19,6 +19,8 @@
package org.apache.uima.tools.jcasgen.maven;
import static java.util.Arrays.asList;
+import static org.apache.maven.plugins.annotations.LifecyclePhase.PROCESS_RESOURCES;
+import static org.apache.maven.plugins.annotations.ResolutionScope.COMPILE;
import java.io.File;
import java.io.FileOutputStream;
@@ -39,10 +41,8 @@ import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.uima.UIMAFramework;
import org.apache.uima.resource.ResourceManager;
@@ -67,7 +67,7 @@ import org.xml.sax.SAXException;
* descriptor files to already be at the appropriate places on the classpath, and the
* generate-resources phase runs before resources are copied.
*/
-@Mojo(name = "generate", defaultPhase = LifecyclePhase.PROCESS_RESOURCES, requiresDependencyResolution = ResolutionScope.COMPILE)
+@Mojo(name = "generate", defaultPhase = PROCESS_RESOURCES, requiresDependencyResolution = COMPILE, threadSafe = true)
public class JCasGenMojo extends AbstractMojo {
@Parameter(defaultValue = "${project}", readonly = true)