@Test public void springBootServerPom() throws GeneratorException, IOException { MultiPomGenerator generator = getGeneratorForSpringBoot(); generator.generate(); File serverPom = Arrays.stream(Objects.requireNonNull(serverFolder.getRoot().listFiles())) .filter(f -> f.getName().equals("pom.xml")).findFirst().orElse(null); assertNotNull(serverPom); String pomAsString = FileUtils.readFileToString(serverPom); assertTrue(pomAsString.contains("${spring-boot.version}")); assertTrue(pomAsString.contains("<spring-boot.version>2.2.2.RELEASE</spring-boot.version>")); assertTrue(pomAsString.contains("<artifactId>spring-boot-starter-web</artifactId>")); assertTrue(pomAsString.contains("<artifactId>spring-boot-maven-plugin</artifactId>")); assertFalse(pomAsString.contains("<artifactId>jetty-maven-plugin</artifactId>")); assertFalse(pomAsString.contains("<artifactId>tomcat7-maven-plugin</artifactId>")); }
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();  }