Commit aede276f authored by Martin Bergljung's avatar Martin Bergljung
Browse files

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

parent 264d326b
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import org.zeroturnaround.zip.ZipUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

import static org.twdata.maven.mojoexecutor.MojoExecutor.*;

@@ -60,6 +61,26 @@ public class IntegrationTestMojo extends AbstractRunMojo {
                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) {
            unpackSolrConfig();
            fixSolrHomePath();