diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/TestDependencyMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/TestDependencyMojo.java index 6627f70..54fc492 100644 --- a/src/main/java/org/jenkinsci/maven/plugins/hpi/TestDependencyMojo.java +++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/TestDependencyMojo.java @@ -6,6 +6,7 @@ import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; 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; @@ -22,7 +23,19 @@ import java.util.Set; */ @Mojo(name="resolve-test-dependencies", requiresDependencyResolution = ResolutionScope.TEST) public class TestDependencyMojo extends AbstractHpiMojo { + + /** + * If true, the test-dependency plugins resolution will be skipped. + */ + @Parameter(property = "maven-hpi-plugin.disabledTestDepPluginsResolution", defaultValue = "false") + private boolean disabledTestDepPluginsResolution; + public void execute() throws MojoExecutionException, MojoFailureException { + + if (!disabledTestDepPluginsResolution) { + return; + } + File testDir = new File(project.getBuild().getTestOutputDirectory(),"test-dependencies"); testDir.mkdirs();