public void execute()

in src/main/java/org/apache/accumulo/maven/plugin/StartMojo.java [107:136]


  public void execute() throws MojoExecutionException {
    if (shouldSkip()) {
      return;
    }

    if (!instanceName.matches("^[a-zA-Z0-9_-]+$")) {
      throw new MojoExecutionException("instanceName must be only letters and numbers");
    }

    File subdir = new File(new File(outputDirectory, "accumulo2-maven-plugin"), instanceName);
    try {
      subdir = subdir.getCanonicalFile();
      if (subdir.exists())
        FileUtils.forceDelete(subdir);
      if (!subdir.mkdirs() && !subdir.isDirectory())
        throw new MojoExecutionException(subdir + " cannot be created as a directory");
      MiniAccumuloConfig cfg = new MiniAccumuloConfig(subdir, rootPassword);
      cfg.setInstanceName(instanceName);
      cfg.setZooKeeperPort(zooKeeperPort);
      configureMiniClasspath(cfg);
      MiniAccumuloCluster mac = new MiniAccumuloCluster(cfg);
      getLog().info("Starting MiniAccumuloCluster: " + mac.getInstanceName() + " in "
          + mac.getConfig().getDir());
      mac.start();
      runningClusters.add(mac);
    } catch (IOException | InterruptedException e) {
      throw new MojoExecutionException(
          "Unable to start " + MiniAccumuloCluster.class.getSimpleName(), e);
    }
  }