Skip to content

Commit

Permalink
Merge pull request #399 from apache/refactoring/398-Mark-Maven-plugin…
Browse files Browse the repository at this point in the history
…s-as-thread-safe

Issue #398: Mark Maven plugins as thread-safe
  • Loading branch information
reckart authored Sep 30, 2024
2 parents 4f0776c + bcebe24 commit e33e8d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,7 +32,6 @@
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;
Expand All @@ -42,7 +43,7 @@
* 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 {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -39,10 +41,8 @@
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;
Expand All @@ -67,7 +67,7 @@
* 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)
Expand Down

0 comments on commit e33e8d0

Please sign in to comment.