Made sure alfresco:run can be executed without interference from alfresco:it,#401

This commit is contained in:
Martin Bergljung 2017-02-28 08:14:27 +00:00
parent 264d326bf2
commit aede276f9b

View File

@ -30,6 +30,7 @@ import org.zeroturnaround.zip.ZipUtil;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Properties;
import static org.twdata.maven.mojoexecutor.MojoExecutor.*; import static org.twdata.maven.mojoexecutor.MojoExecutor.*;
@ -60,6 +61,26 @@ public class IntegrationTestMojo extends AbstractRunMojo {
pluginManager pluginManager
); );
// Check if we should skip this Mojo execution, i.e. if tests have been
// skipped by the user
Properties sysProperties = execEnv.getMavenSession().getSystemProperties();
boolean skipThisMojo = sysProperties.containsKey("skipTests") ||
sysProperties.containsKey("skipITs") ||
sysProperties.containsKey("maven.test.skip");
if (skipThisMojo) {
getLog().info("Skipping integration testing.");
return;
}
List<String> goals = execEnv.getMavenSession().getGoals();
if (goals.contains("alfresco:run")) {
sysProperties.put("skipTests", "true");
getLog().info("Skipping integration testing as alfresco:run is active.");
return;
}
// execEnv.getMavenSession().getGoals().add("alfresco:it");
if (enableSolr) { if (enableSolr) {
unpackSolrConfig(); unpackSolrConfig();
fixSolrHomePath(); fixSolrHomePath();