// Path: src/main/java-templates/org/ktc/soapui/maven/extension/impl/ProjectInfo.java
// public class ProjectInfo {
// 
//     public static String getName() {
//         return "${project.artifactId}";
//     }
// 
//     public static String getVersion() {
//         return "${project.version}";
//     }
// 
//     public static String getFullVersion() {
//         return getVersion() + " (${buildnumber-scm-changeset}; ${buildnumber-date})";
//     }
//     
//     public static String getSoapuiVersion() {
//         return "${soapuiVersionCurrent}";
//     }
// 
// }
// 
// Path: src/main/java/org/ktc/soapui/maven/extension/impl/RunnerType.java
// public enum RunnerType {
//     PRO {
//         @Override
//         public SoapUITestCaseRunner newTestRunner() {
//             return new SoapUIProExtensionTestCaseRunner("SoapUI Pro Maven2 TestCase Runner");
//         }
// 
//         @Override
//         public SoapUIMockServiceRunner newMockRunner() {
//             return new SoapUIProExtensionMockServiceRunner("SoapUI Pro Maven2 MockService Runner");
//         }
// 
//         @Override
//         public SoapUIMockAsWarGenerator newMockAsWarGenerator() {
//             // currently no constructor with String arguments
//             return new SoapUIProMockAsWarGenerator();
//         }
// 
//         @Override
//         public boolean isProRunner() {
//             return true;
//         }
// 
//     },
//     OSS {
//         @Override
//         public SoapUITestCaseRunner newTestRunner() {
//             return new SoapUIExtensionTestCaseRunner("SoapUI Maven2 TestCase Runner");
//         }
// 
//         @Override
//         public SoapUIMockServiceRunner newMockRunner() {
//             return new SoapUIExtensionMockServiceRunner("SoapUI Maven2 MockService Runner");
//         }
// 
//         @Override
//         public SoapUIMockAsWarGenerator newMockAsWarGenerator() {
//             return new SoapUIExtensionMockAsWarGenerator("SoapUI Maven2 MockAsWar Generator");
//         }
// 
//         @Override
//         public boolean isProRunner() {
//             return false;
//         }
// 
//     };
// 
//     public abstract SoapUITestCaseRunner newTestRunner();
// 
//     public abstract SoapUIMockServiceRunner newMockRunner();
// 
//     public abstract SoapUIMockAsWarGenerator newMockAsWarGenerator();
// 
//     public abstract boolean isProRunner();
// }
// 
// Path: src/main/java/org/ktc/soapui/maven/extension/impl/enums/EnumConverter.java
// public class EnumConverter {
// 
//     public static ProjectConversionType toProjectConversionType(String value) {
//         try {
//             return ProjectConversionType.valueOf(value);
//         } catch (RuntimeException e) {
//             throw new UnknownEnumException("Unsupported project conversion type " + value + ". Valid values are "
//                     + buildEnumValuesToString(ProjectConversionType.values()) + "", e);
//         }
//     }
// 
//     public static RunnerType toRunnerType(String value) {
//         try {
//             return RunnerType.valueOf(value);
//         } catch (RuntimeException e) {
//             throw new UnknownEnumException("Unsupported runner type " + value + ". Valid values are "
//                     + buildEnumValuesToString(RunnerType.values()) + "", e);
//         }
//     }
// 
//     private static String buildEnumValuesToString(Object[] values) {
//         return "[" + StringUtils.join(values, ',') + "]";
//     }
//     
// }


import static org.sonatype.aether.util.filter.DependencyFilterUtils.classpathFilter;
import com.eviware.soapui.tools.SoapUIMockAsWarGenerator;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.maven.model.Build;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.ktc.soapui.maven.extension.impl.ProjectInfo;
import org.ktc.soapui.maven.extension.impl.RunnerType;
import org.ktc.soapui.maven.extension.impl.enums.EnumConverter;
import org.sonatype.aether.RepositorySystem;
import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.collection.CollectRequest;
import org.sonatype.aether.graph.Dependency;
import org.sonatype.aether.repository.RemoteRepository;
import org.sonatype.aether.resolution.ArtifactResult;
import org.sonatype.aether.resolution.DependencyRequest;
import org.sonatype.aether.resolution.DependencyResolutionException;
import org.sonatype.aether.util.artifact.DefaultArtifact;
import org.sonatype.aether.util.artifact.JavaScopes;
                warFile.getParentFile().mkdirs();
                runner.setWarFile(warFile.getAbsolutePath());
            }

            // specific configuration
             runner.setEnableWebUI(enableWebUI);
            // runner.setLocalEndpoint(null);
            // TODO related java system properties must be correctly set (add documentation)
            // WARN the mock generator does not respect properties (it used directories in the soapui.home directory)
            // runner.setIncludeActions(false);
            // runner.setIncludeLibraries(false);
            // runner.setIncludeListeners(false);

            // TODO pro feature: include scripts

            runner.run();
        } catch (Exception e) {
            getLog().debug(e);
            throw new MojoFailureException("SoapUI has errors: " + e.getMessage(), e);
        }
    }

    // TODO extend this: add a boolean parameter to specify if jars must be downloaded
    // can create the /ext and /script (pro only?) directory
    // if system properties are not set to configure the 2 directories, set them to use directories in soapui fake. This
    // will avoid warning on soapui startup
    // if the soapui.home property if already set, we should restore the initial value after the call of this mojo
    private void buildSoapuiGuiEnvironment() throws DependencyResolutionException, IOException {
        getLog().info("Building a SoapUI Gui environment");

// Path: src/main/java-templates/org/ktc/soapui/maven/extension/impl/ProjectInfo.java
// public class ProjectInfo {
// 
//     public static String getName() {
//         return "${project.artifactId}";
//     }
// 
//     public static String getVersion() {
//         return "${project.version}";
//     }
// 
//     public static String getFullVersion() {
//         return getVersion() + " (${buildnumber-scm-changeset}; ${buildnumber-date})";
//     }
//     
//     public static String getSoapuiVersion() {
//         return "${soapuiVersionCurrent}";
//     }
// 
// }
// 
// Path: src/main/java/org/ktc/soapui/maven/extension/impl/RunnerType.java
// public enum RunnerType {
//     PRO {
//         @Override
//         public SoapUITestCaseRunner newTestRunner() {
//             return new SoapUIProExtensionTestCaseRunner("SoapUI Pro Maven2 TestCase Runner");
//         }
// 
//         @Override
//         public SoapUIMockServiceRunner newMockRunner() {
//             return new SoapUIProExtensionMockServiceRunner("SoapUI Pro Maven2 MockService Runner");
//         }
// 
//         @Override
//         public SoapUIMockAsWarGenerator newMockAsWarGenerator() {
//             // currently no constructor with String arguments
//             return new SoapUIProMockAsWarGenerator();
//         }
// 
//         @Override
//         public boolean isProRunner() {
//             return true;
//         }
// 
//     },
//     OSS {
//         @Override
//         public SoapUITestCaseRunner newTestRunner() {
//             return new SoapUIExtensionTestCaseRunner("SoapUI Maven2 TestCase Runner");
//         }
// 
//         @Override
//         public SoapUIMockServiceRunner newMockRunner() {
//             return new SoapUIExtensionMockServiceRunner("SoapUI Maven2 MockService Runner");
//         }
// 
//         @Override
//         public SoapUIMockAsWarGenerator newMockAsWarGenerator() {
//             return new SoapUIExtensionMockAsWarGenerator("SoapUI Maven2 MockAsWar Generator");
//         }
// 
//         @Override
//         public boolean isProRunner() {
//             return false;
//         }
// 
//     };
// 
//     public abstract SoapUITestCaseRunner newTestRunner();
// 
//     public abstract SoapUIMockServiceRunner newMockRunner();
// 
//     public abstract SoapUIMockAsWarGenerator newMockAsWarGenerator();
// 
//     public abstract boolean isProRunner();
// }
// 
// Path: src/main/java/org/ktc/soapui/maven/extension/impl/enums/EnumConverter.java
// public class EnumConverter {
// 
//     public static ProjectConversionType toProjectConversionType(String value) {
//         try {
//             return ProjectConversionType.valueOf(value);
//         } catch (RuntimeException e) {
//             throw new UnknownEnumException("Unsupported project conversion type " + value + ". Valid values are "
//                     + buildEnumValuesToString(ProjectConversionType.values()) + "", e);
//         }
//     }
// 
//     public static RunnerType toRunnerType(String value) {
//         try {
//             return RunnerType.valueOf(value);
//         } catch (RuntimeException e) {
//             throw new UnknownEnumException("Unsupported runner type " + value + ". Valid values are "
//                     + buildEnumValuesToString(RunnerType.values()) + "", e);
//         }
//     }
// 
//     private static String buildEnumValuesToString(Object[] values) {
//         return "[" + StringUtils.join(values, ',') + "]";
//     }
//     
// }


// Path: src/main/java/org/ktc/soapui/maven/extension/MockAsWarMojo.java
import static org.sonatype.aether.util.filter.DependencyFilterUtils.classpathFilter;
import com.eviware.soapui.tools.SoapUIMockAsWarGenerator;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.maven.model.Build;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.ktc.soapui.maven.extension.impl.ProjectInfo;
import org.ktc.soapui.maven.extension.impl.RunnerType;
import org.ktc.soapui.maven.extension.impl.enums.EnumConverter;
import org.sonatype.aether.RepositorySystem;
import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.collection.CollectRequest;
import org.sonatype.aether.graph.Dependency;
import org.sonatype.aether.repository.RemoteRepository;
import org.sonatype.aether.resolution.ArtifactResult;
import org.sonatype.aether.resolution.DependencyRequest;
import org.sonatype.aether.resolution.DependencyResolutionException;
import org.sonatype.aether.util.artifact.DefaultArtifact;
import org.sonatype.aether.util.artifact.JavaScopes;

                warFile.getParentFile().mkdirs();
                runner.setWarFile(warFile.getAbsolutePath());
            }

            // specific configuration
             runner.setEnableWebUI(enableWebUI);
            // runner.setLocalEndpoint(null);
            // TODO related java system properties must be correctly set (add documentation)
            // WARN the mock generator does not respect properties (it used directories in the soapui.home directory)
            // runner.setIncludeActions(false);
            // runner.setIncludeLibraries(false);
            // runner.setIncludeListeners(false);

            // TODO pro feature: include scripts

            runner.run();
        } catch (Exception e) {
            getLog().debug(e);
            throw new MojoFailureException("SoapUI has errors: " + e.getMessage(), e);
        }
    }

    // TODO extend this: add a boolean parameter to specify if jars must be downloaded
    // can create the /ext and /script (pro only?) directory
    // if system properties are not set to configure the 2 directories, set them to use directories in soapui fake. This
    // will avoid warning on soapui startup
    // if the soapui.home property if already set, we should restore the initial value after the call of this mojo
    private void buildSoapuiGuiEnvironment() throws DependencyResolutionException, IOException {
        getLog().info("Building a SoapUI Gui environment");

        String version = ProjectInfo.getVersion();