Closed hurelhuyag closed 4 months ago
I tried to use 2 use 2 execution setup in maven pom.xml. But the output is empty.
<plugin> <groupId>gg.jte</groupId> <artifactId>jte-maven-plugin</artifactId> <version>${jte.version}</version> <executions> <execution> <id>generate-jte-html</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <sourceDirectory>${basedir}/src/main/jte/</sourceDirectory> <targetDirectory>${project.build.directory}/jte-classes</targetDirectory> <contentType>Html</contentType> </configuration> </execution> <execution> <id>generate-jte-plain</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <sourceDirectory>${basedir}/src/main/jte-plain/</sourceDirectory> <targetDirectory>${project.build.directory}/jte-classes</targetDirectory> <contentType>Plain</contentType> </configuration> </execution> </executions> </plugin>
Used example code:
public class GenerateWWW { private final TemplateEngine templateEngine = TemplateEngine.createPrecompiled(ContentType.Plain); public GenerateWWW() throws IOException { var path = Path.of("/home/hurlee/Desktop/domain.com.nginx"); var output = new FileOutput(path, StandardCharsets.UTF_8); templateEngine.render( "nginx_with_www.jte", Map.of("domain", "domain.com", "withSsl", false), output ); } public static void main(String[] args) throws IOException { new GenerateWWW(); } }
I think you'll need to provide two different target directories.
I tried to use 2 use 2 execution setup in maven pom.xml. But the output is empty.
Used example code: