예제 #1
0
  public void execute() throws MojoExecutionException {

    AetherUtil.setRepositorySystemSession(repoSession);
    AetherUtil.setRepositorySystem(repoSystem);

    mergerComponent = new KevoreeMergerComponent();

    ContainerRoot model = KevoreeFactory.createContainerRoot();

    if (sourceMarShellDirectory != null) {
      ContainerRoot model2 = executeOnDirectory(sourceMarShellDirectory);
      mergerComponent.merge(model, model2);
    }

    if (sourceMarShellDirectory2 != null) {
      ContainerRoot model2 = executeOnDirectory(sourceMarShellDirectory2);
      mergerComponent.merge(model, model2);
    }

    if (!sourceOutputDirectory.exists() && !sourceOutputDirectory.mkdirs()) {
      throw new MojoExecutionException(
          "Unable to build target packages " + sourceOutputDirectory.getAbsolutePath());
    }

    KevoreeXmiHelper.save(
        sourceOutputDirectory.getAbsolutePath() + File.separator + "lib.kev", model);

    Resource resource = new Resource();
    resource.setTargetPath("KEV-INF");
    resource.setDirectory(sourceOutputDirectory.getAbsolutePath());

    project.addResource(resource);
  }