Skip to content

Commit

Permalink
WINDUP-1086 adding one level of directory in mavenized dir for specif…
Browse files Browse the repository at this point in the history
…ic Application
  • Loading branch information
mareknovotny committed Jun 15, 2016
1 parent d157733 commit 7c514ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
@@ -1,10 +1,6 @@
package org.jboss.windup.rules.apps.mavenize;

import freemarker.core.ParseException;
import freemarker.template.DefaultObjectWrapperBuilder;
import freemarker.template.MalformedTemplateNameException;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -15,12 +11,18 @@
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jboss.windup.graph.model.WindupConfigurationModel;
import org.jboss.windup.reporting.freemarker.FurnaceFreeMarkerTemplateLoader;
import org.jboss.windup.util.Logging;
import org.jboss.windup.util.exception.WindupException;

import freemarker.core.ParseException;
import freemarker.template.DefaultObjectWrapperBuilder;
import freemarker.template.Template;
import freemarker.template.TemplateException;

/**
* Recursively renders the previously created Maven project structure into pom.xml's in a directory tree.
*
Expand All @@ -43,15 +45,16 @@ public class MavenStructureRenderer
void createMavenProjectDirectoryTree()
{
try {
Path mavenizedAppPath = (new File(mavCtx.getMavenizedBaseDir().toString(), mavCtx.getUnifiedAppName())).toPath();
// Root POM
renderPomXml(mavCtx, mavCtx.getRootPom(), mavCtx.getMavenizedBaseDir().resolve("pom.xml"));
renderPomXml(mavCtx, mavCtx.getRootPom(), mavenizedAppPath.resolve("pom.xml"));

List<Throwable> exceptions = new ArrayList<>();
for (Map.Entry<String, Pom> entry : mavCtx.getRootPom().submodules.entrySet())
{
try {
String subDir = entry.getKey();
Path resultPomXmlPath = mavCtx.getMavenizedBaseDir().resolve(subDir).resolve("pom.xml");
Path resultPomXmlPath = mavenizedAppPath.resolve(subDir).resolve("pom.xml");
LOG.info("Writing " + subDir + "/pom.xml" + "\n > " + entry.getValue());
renderPomXml(mavCtx, entry.getValue(), resultPomXmlPath);
}
Expand Down
Expand Up @@ -24,8 +24,6 @@
import org.jboss.windup.exec.configuration.WindupConfiguration;
import org.jboss.windup.graph.GraphContext;
import org.jboss.windup.graph.GraphContextFactory;
import org.jboss.windup.graph.model.ProjectModel;
import org.jboss.windup.graph.model.resource.FileModel;
import org.jboss.windup.rules.apps.java.archives.identify.CompositeArchiveIdentificationService;
import org.jboss.windup.rules.apps.java.archives.identify.InMemoryArchiveIdentificationService;
import org.jboss.windup.rules.apps.java.archives.model.IdentifiedArchiveModel;
Expand Down

0 comments on commit 7c514ad

Please sign in to comment.