From 7dcf90805603c48dbe1fd470df9bd57d58bc66ff Mon Sep 17 00:00:00 2001 From: grabdoc Date: Sat, 30 Nov 2024 04:57:17 -0600 Subject: [PATCH] #821 - pre-compiling to load jte templates. --- api-rest/pom.xml | 20 +++++++++++++++++++ .../jdbc/config/JdbcConfiguration.java | 5 +++-- pom.xml | 5 ++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/api-rest/pom.xml b/api-rest/pom.xml index 42c79530..c2eb8193 100644 --- a/api-rest/pom.xml +++ b/api-rest/pom.xml @@ -224,6 +224,26 @@ + + + gg.jte + jte-maven-plugin + ${jte.version} + + + ${project.basedir}/src/main/resources/sql-templates + Plain + + + + generate-sources + + generate + + + + + org.asciidoctor asciidoctor-maven-plugin diff --git a/api-rest/src/main/java/com/homihq/db2rest/jdbc/config/JdbcConfiguration.java b/api-rest/src/main/java/com/homihq/db2rest/jdbc/config/JdbcConfiguration.java index a4582a90..85b9c4be 100644 --- a/api-rest/src/main/java/com/homihq/db2rest/jdbc/config/JdbcConfiguration.java +++ b/api-rest/src/main/java/com/homihq/db2rest/jdbc/config/JdbcConfiguration.java @@ -130,8 +130,9 @@ public SqlCreatorTemplate sqlCreatorTemplate(TemplateEngine templateEngine, Jdbc @Bean public TemplateEngine templateEngine() { CodeResolver codeResolver = - new ResourceCodeResolver("sql-templates", this.getClass().getClassLoader()); - return TemplateEngine.create(codeResolver, ContentType.Plain); + new ResourceCodeResolver("sql-templates"); + return TemplateEngine + .createPrecompiled(ContentType.Plain); } @Bean diff --git a/pom.xml b/pom.xml index 704d673d..475b9627 100644 --- a/pom.xml +++ b/pom.xml @@ -75,10 +75,13 @@ - 1.3.1 + 1.4.1 21 3.0.1 2.17.2 + + 3.1.12 +