// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String CONFIG_OPERATION_DEPLOY = "deploy";
// 
// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String CONFIG_OPERATION_UNDEPLOY = "undeploy";
// 
// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String EI_SERVER = "ei";
// 
// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String MI_SERVER = "mi";


import static org.wso2.maven.car.artifact.util.Constants.CONFIG_OPERATION_DEPLOY;
import static org.wso2.maven.car.artifact.util.Constants.CONFIG_OPERATION_UNDEPLOY;
import static org.wso2.maven.car.artifact.util.Constants.EI_SERVER;
import static org.wso2.maven.car.artifact.util.Constants.MI_SERVER;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.io.File;
import java.util.List;
                if (finalNameNode != null) {
                    finalName = finalNameNode.getValue();
                    getLog().info("Final Name of C-App: " + finalName + EXTENSION_CAR);
                }
                break;
            }
        }

        File carFile = null;
        if (null != archiveLocation) { // If default target location is changed by user
            if (archiveLocation.isFile() && archiveLocation.getName().endsWith(EXTENSION_CAR)) {
                carFile = archiveLocation;
            } else {
                throw new MojoExecutionException("Archive location is not a valid file");
            }
        } else { // Default target file
            if (finalName == null) {
                carFile = new File(target + File.separator + project.getArtifactId() + "_" +
                        project.getVersion() + EXTENSION_CAR);
            } else {
                carFile = new File(target + File.separator + finalName + EXTENSION_CAR);
            }
        }

        if (isValidServerType()) {
            cAppHandler = getCAppHandler();
        } else {
            throw new MojoExecutionException("Unsupported serverType. Only allows \"mi\" or \"ei\" ");
        }

// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String CONFIG_OPERATION_DEPLOY = "deploy";
// 
// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String CONFIG_OPERATION_UNDEPLOY = "undeploy";
// 
// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String EI_SERVER = "ei";
// 
// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public static final String MI_SERVER = "mi";


// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/DeployCarMojo.java
import static org.wso2.maven.car.artifact.util.Constants.CONFIG_OPERATION_DEPLOY;
import static org.wso2.maven.car.artifact.util.Constants.CONFIG_OPERATION_UNDEPLOY;
import static org.wso2.maven.car.artifact.util.Constants.EI_SERVER;
import static org.wso2.maven.car.artifact.util.Constants.MI_SERVER;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.io.File;
import java.util.List;

                if (finalNameNode != null) {
                    finalName = finalNameNode.getValue();
                    getLog().info("Final Name of C-App: " + finalName + EXTENSION_CAR);
                }
                break;
            }
        }

        File carFile = null;
        if (null != archiveLocation) { // If default target location is changed by user
            if (archiveLocation.isFile() && archiveLocation.getName().endsWith(EXTENSION_CAR)) {
                carFile = archiveLocation;
            } else {
                throw new MojoExecutionException("Archive location is not a valid file");
            }
        } else { // Default target file
            if (finalName == null) {
                carFile = new File(target + File.separator + project.getArtifactId() + "_" +
                        project.getVersion() + EXTENSION_CAR);
            } else {
                carFile = new File(target + File.separator + finalName + EXTENSION_CAR);
            }
        }

        if (isValidServerType()) {
            cAppHandler = getCAppHandler();
        } else {
            throw new MojoExecutionException("Unsupported serverType. Only allows \"mi\" or \"ei\" ");
        }

        if (operation.equalsIgnoreCase(CONFIG_OPERATION_DEPLOY)) {