@Test public void springBootClientPom() throws GeneratorException, IOException { MultiPomGenerator generator = getGeneratorForSpringBoot(); generator.generate(); File clientPom = Arrays.stream(Objects.requireNonNull(clientFolder.getRoot().listFiles())) .filter(f -> f.getName().equals("pom.xml")).findFirst().orElse(null); assertNotNull(clientPom); String pomAsString = FileUtils.readFileToString(clientPom); assertTrue(pomAsString.contains("<spring-boot.public.dir>")); assertTrue(pomAsString.contains("<launcherDir>${spring-boot.public.dir}</launcherDir>")); assertTrue(pomAsString.contains("<warDir>${spring-boot.public.dir}</warDir>")); }
public void generate() throws GeneratorException { Configuration freeMarkerConfiguration = new Configuration(); freeMarkerConfiguration.setClassForTemplateLoading(MultiPomGenerator.class, "/templates/pom"); freeMarkerConfiguration.setDefaultEncoding("UTF-8"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< start generating pom"); this.generateProjectPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating pom successfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom"); this.generateProjectClientPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom"); this.generateProjectSharedPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom"); this.generateProjectServerPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom sucessfully finished"); }
MultiPomGenerator { public void generate() throws GeneratorException { Configuration freeMarkerConfiguration = new Configuration(); freeMarkerConfiguration.setClassForTemplateLoading(MultiPomGenerator.class, "/templates/pom"); freeMarkerConfiguration.setDefaultEncoding("UTF-8"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< start generating pom"); this.generateProjectPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating pom successfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom"); this.generateProjectClientPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom"); this.generateProjectSharedPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom"); this.generateProjectServerPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom sucessfully finished"); } }
MultiPomGenerator { public void generate() throws GeneratorException { Configuration freeMarkerConfiguration = new Configuration(); freeMarkerConfiguration.setClassForTemplateLoading(MultiPomGenerator.class, "/templates/pom"); freeMarkerConfiguration.setDefaultEncoding("UTF-8"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< start generating pom"); this.generateProjectPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating pom successfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom"); this.generateProjectClientPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom"); this.generateProjectSharedPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom"); this.generateProjectServerPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom sucessfully finished"); } private  MultiPomGenerator(Builder builder); }
MultiPomGenerator { public void generate() throws GeneratorException { Configuration freeMarkerConfiguration = new Configuration(); freeMarkerConfiguration.setClassForTemplateLoading(MultiPomGenerator.class, "/templates/pom"); freeMarkerConfiguration.setDefaultEncoding("UTF-8"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< start generating pom"); this.generateProjectPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating pom successfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom"); this.generateProjectClientPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom"); this.generateProjectSharedPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom"); this.generateProjectServerPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom sucessfully finished"); } private  MultiPomGenerator(Builder builder); static Builder builder(); void generate(); }
MultiPomGenerator { public void generate() throws GeneratorException { Configuration freeMarkerConfiguration = new Configuration(); freeMarkerConfiguration.setClassForTemplateLoading(MultiPomGenerator.class, "/templates/pom"); freeMarkerConfiguration.setDefaultEncoding("UTF-8"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< start generating pom"); this.generateProjectPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating pom successfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom"); this.generateProjectClientPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom"); this.generateProjectSharedPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom"); this.generateProjectServerPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom sucessfully finished"); } private  MultiPomGenerator(Builder builder); static Builder builder(); void generate();  }