@Test public void testBlankExecute() throws Exception { CreateMojo mojo = new CreateMojo(); mojo.artifactId = "create-test"; mojo.groupId = "test-group"; mojo.version = "1.0-SNAPSHOT"; mojo.skel = "blank"; final String packageName = "org.acme"; mojo.packageName = packageName; mojo.basedir = WORK; if (!mojo.basedir.exists()) { mojo.basedir.mkdirs(); } mojo.execute(); File root = new File(mojo.basedir, mojo.artifactId); assertThat(root).isDirectory(); assertThat(new File(root, "pom.xml")) .exists() .has(include("<artifactId>" + mojo.artifactId + "</artifactId>")) .has(include("<groupId>" + mojo.groupId + "</groupId>")) .has(include("<version>" + mojo.version + "</version>")) .has(include("wisdom-api")) .has(include("wisdom-test")) .has(include("wisdom-api")) .has(include("wisdom-maven-plugin")); assertThat(new File(root, "src/main/templates/error")) .isDirectory() .has(child("404.thl.html")) .has(child("500.thl.html")); assertThat(new File(root, "src/main/resources/templates")) .isDirectory() .doesNotHave(child("welcome.thl.html")); assertThat(new File(root, "src/main/resources/assets")) .isDirectory() .doesNotHave(child("main.less")); assertThat(new File(root, "src/main/configuration/application.conf")) .isFile() .has(include("secret =")); assertThat(new File(root, "src/main/java/" + packageName.replace(".", "/"))).isDirectory() .doesNotHave(child("WelcomeController.java")); }
@Override public void execute() throws MojoExecutionException { try { ensureNotExisting(); createDirectories(); if ("blank".equalsIgnoreCase(skel)) { createApplicationConfiguration(); createBlankPomFile(); createPackageStructure(); copyDefaultErrorTemplates(); } else { createApplicationConfiguration(); createPomFile(); createPackageStructure(); createDefaultController(); createTests(); copyAssets(); createWelcomeTemplate(); copyDefaultErrorTemplates(); } printStartGuide(); } catch (IOException e) { throw new MojoExecutionException("Error during project generation", e); } }
CreateMojo extends AbstractWisdomMojo { @Override public void execute() throws MojoExecutionException { try { ensureNotExisting(); createDirectories(); if ("blank".equalsIgnoreCase(skel)) { createApplicationConfiguration(); createBlankPomFile(); createPackageStructure(); copyDefaultErrorTemplates(); } else { createApplicationConfiguration(); createPomFile(); createPackageStructure(); createDefaultController(); createTests(); copyAssets(); createWelcomeTemplate(); copyDefaultErrorTemplates(); } printStartGuide(); } catch (IOException e) { throw new MojoExecutionException("Error during project generation", e); } } }
CreateMojo extends AbstractWisdomMojo { @Override public void execute() throws MojoExecutionException { try { ensureNotExisting(); createDirectories(); if ("blank".equalsIgnoreCase(skel)) { createApplicationConfiguration(); createBlankPomFile(); createPackageStructure(); copyDefaultErrorTemplates(); } else { createApplicationConfiguration(); createPomFile(); createPackageStructure(); createDefaultController(); createTests(); copyAssets(); createWelcomeTemplate(); copyDefaultErrorTemplates(); } printStartGuide(); } catch (IOException e) { throw new MojoExecutionException("Error during project generation", e); } }  }
CreateMojo extends AbstractWisdomMojo { @Override public void execute() throws MojoExecutionException { try { ensureNotExisting(); createDirectories(); if ("blank".equalsIgnoreCase(skel)) { createApplicationConfiguration(); createBlankPomFile(); createPackageStructure(); copyDefaultErrorTemplates(); } else { createApplicationConfiguration(); createPomFile(); createPackageStructure(); createDefaultController(); createTests(); copyAssets(); createWelcomeTemplate(); copyDefaultErrorTemplates(); } printStartGuide(); } catch (IOException e) { throw new MojoExecutionException("Error during project generation", e); } }  @Override void execute(); }
CreateMojo extends AbstractWisdomMojo { @Override public void execute() throws MojoExecutionException { try { ensureNotExisting(); createDirectories(); if ("blank".equalsIgnoreCase(skel)) { createApplicationConfiguration(); createBlankPomFile(); createPackageStructure(); copyDefaultErrorTemplates(); } else { createApplicationConfiguration(); createPomFile(); createPackageStructure(); createDefaultController(); createTests(); copyAssets(); createWelcomeTemplate(); copyDefaultErrorTemplates(); } printStartGuide(); } catch (IOException e) { throw new MojoExecutionException("Error during project generation", e); } }  @Override void execute(); @Parameter(defaultValue = "quickstart")
    public String skel; @Parameter(required = true, defaultValue = "${artifactId}")
    public String artifactId; @Parameter(required = true, defaultValue = "${groupId}")
    public String groupId; @Parameter(required = true, defaultValue = "${version}")
    public String version; @Parameter(required = false, defaultValue = "${package}")
    public String packageName; }