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); }
@Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { if (includeRubyResources != null) { // add it to the classpath so java classes can find the ruby files Resource resource = new Resource(); resource.setDirectory(project.getBasedir().getAbsolutePath()); for (String include : includeRubyResources) { resource.addInclude(include); } if (excludeRubyResources != null) { for (String exclude : excludeRubyResources) { resource.addExclude(exclude); } } addResource(project.getBuild().getResources(), resource); } if (includeBinStubs) { Resource resource = new Resource(); resource.setDirectory(gemsConfig.getBinDirectory().getAbsolutePath()); resource.addInclude("*"); resource.setTargetPath("META-INF/jruby.home/bin"); addResource(project.getBuild().getResources(), resource); } }
protected void includeDescriptorResource() { final Resource resource = new Resource(); final String sourcePath = outputDirectorySCR().getPath(); final String targetPath = targetDirectorySCR; resource.setDirectory(sourcePath); resource.setTargetPath(targetPath); getLog().info(""); getLog().info("including descriptor resource = " + resource); project.addResource(resource); }