Skip to content

Commit 164393d

Browse files
authored
Upgrade to Handlebars 4.5.3 (#2927)
Resolves security issues Handlebars 4.4+ requires Java 17 or higher and Handlebars 4.3 is no longer maintained. Besides, the library now has a proper module name instead of an automatic one. Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent dc875ac commit 164393d

3 files changed

Lines changed: 52 additions & 3 deletions

File tree

vertx-template-engines/vertx-web-templ-handlebars/pom.xml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>com.github.jknack</groupId>
1919
<artifactId>handlebars</artifactId>
20-
<version>4.3.1</version>
20+
<version>4.5.3</version>
2121
<exclusions>
2222
<exclusion>
2323
<groupId>org.slf4j</groupId>
@@ -45,4 +45,53 @@
4545
</plugins>
4646
</build>
4747

48+
<!-- Java 11 => use Maven Toolchain to compile this module with JDK 25
49+
The config file .m2/toolchains.xml is needed with this content
50+
51+
<toolchains>
52+
<toolchain>
53+
<type>jdk</type>
54+
<provides>
55+
<id>Java25</id>
56+
<version>25</version>
57+
</provides>
58+
<configuration>
59+
<jdkHome>/PATH/TO/JDK/25</jdkHome>
60+
</configuration>
61+
</toolchain>
62+
</toolchains>
63+
-->
64+
<profiles>
65+
<profile>
66+
<id>Java11</id>
67+
<activation>
68+
<jdk>[11,17)</jdk>
69+
</activation>
70+
<build>
71+
<plugins>
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-toolchains-plugin</artifactId>
75+
<version>1.0</version>
76+
<executions>
77+
<execution>
78+
<phase>validate</phase>
79+
<goals>
80+
<goal>toolchain</goal>
81+
</goals>
82+
</execution>
83+
</executions>
84+
<configuration>
85+
<toolchains>
86+
<jdk>
87+
<version>25</version>
88+
</jdk>
89+
</toolchains>
90+
</configuration>
91+
</plugin>
92+
</plugins>
93+
</build>
94+
</profile>
95+
</profiles>
96+
4897
</project>

vertx-template-engines/vertx-web-templ-handlebars/src/main/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
requires io.netty.common;
2121
requires io.vertx.core;
2222
requires io.vertx.web.common;
23-
requires handlebars; // Automatic module
23+
requires com.github.jknack.handlebars;
2424

2525
exports io.vertx.ext.web.templ.handlebars;
2626
}

vertx-template-engines/vertx-web-templ-handlebars/src/test/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
requires io.vertx.core;
1919
requires io.vertx.web.common;
2020
requires io.vertx.web.template.handlebars;
21-
requires handlebars;
21+
requires com.github.jknack.handlebars;
2222
requires org.junit.jupiter.api;
2323
}

0 commit comments

Comments
 (0)