Skip to content

Commit 1076f94

Browse files
authored
Merge pull request #2 from phuongnq/security/cs-1110-update-dependencies-4x
Update dependencies and Java to 21
2 parents ff8e405 + d042f98 commit 1076f94

9 files changed

Lines changed: 92 additions & 41 deletions

File tree

handlebars-caffeine/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>com.github.ben-manes.caffeine</groupId>
2525
<artifactId>caffeine</artifactId>
26-
<version>3.1.8</version>
26+
<version>3.2.0</version>
2727
</dependency>
2828

2929
<!-- Test dependencies -->

handlebars-guava-cache/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<dependency>
2525
<groupId>com.google.guava</groupId>
2626
<artifactId>guava</artifactId>
27-
<version>33.2.1-jre</version>
27+
<version>33.4.6-jre</version>
2828
</dependency>
2929

3030
<!-- Test dependencies -->
@@ -60,7 +60,7 @@
6060
<plugin>
6161
<groupId>org.apache.maven.plugins</groupId>
6262
<artifactId>maven-surefire-plugin</artifactId>
63-
<version>3.3.0</version>
63+
<version>3.5.3</version>
6464
<configuration>
6565
<!-- set default locale of the test JVM to en_US because some tests expect e.g. the dollar sign as currency symbol -->
6666
<argLine>-Duser.language=en -Duser.country=US</argLine>

handlebars-helpers/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<dependency>
3030
<groupId>joda-time</groupId>
3131
<artifactId>joda-time</artifactId>
32-
<version>2.12.7</version>
32+
<version>2.14.0</version>
3333
<optional>true</optional>
3434
</dependency>
3535

handlebars-maven-plugin/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,38 @@
3535
<dependency>
3636
<groupId>org.apache.maven</groupId>
3737
<artifactId>maven-plugin-api</artifactId>
38-
<version>3.9.8</version>
38+
<version>3.9.9</version>
3939
</dependency>
4040

4141
<dependency>
4242
<groupId>org.apache.maven</groupId>
4343
<artifactId>maven-core</artifactId>
44-
<version>3.9.8</version>
44+
<version>3.9.9</version>
4545
</dependency>
4646

4747
<dependency>
4848
<groupId>org.apache.maven.plugin-tools</groupId>
4949
<artifactId>maven-plugin-annotations</artifactId>
50-
<version>3.13.1</version>
50+
<version>3.15.1</version>
5151
<scope>provided</scope>
5252
</dependency>
5353

5454
<dependency>
5555
<groupId>org.codehaus.plexus</groupId>
5656
<artifactId>plexus-utils</artifactId>
57-
<version>4.0.1</version>
57+
<version>4.0.2</version>
5858
</dependency>
5959

6060
<dependency>
6161
<groupId>org.codehaus.plexus</groupId>
6262
<artifactId>plexus-xml</artifactId>
63-
<version>4.0.4</version>
63+
<version>4.1.0</version>
6464
</dependency>
6565

6666
<dependency>
6767
<groupId>com.google.javascript</groupId>
6868
<artifactId>closure-compiler</artifactId>
69-
<version>v20240317</version>
69+
<version>v20250402</version>
7070
</dependency>
7171

7272
<!-- Test dependencies -->
@@ -96,7 +96,7 @@
9696
<plugin>
9797
<groupId>org.apache.maven.plugins</groupId>
9898
<artifactId>maven-plugin-plugin</artifactId>
99-
<version>3.13.1</version>
99+
<version>3.15.1</version>
100100
<configuration>
101101
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
102102
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>

handlebars/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
<plugin>
121121
<groupId>org.apache.felix</groupId>
122122
<artifactId>maven-bundle-plugin</artifactId>
123-
<version>5.1.9</version>
123+
<version>6.0.0</version>
124124
<executions>
125125
<execution>
126126
<id>bundle-manifest</id>
@@ -202,7 +202,7 @@
202202
<dependency>
203203
<groupId>org.junit.platform</groupId>
204204
<artifactId>junit-platform-suite</artifactId>
205-
<version>1.10.3</version>
205+
<version>1.12.1</version>
206206
<scope>test</scope>
207207
</dependency>
208208

@@ -227,7 +227,7 @@
227227
<dependency>
228228
<groupId>commons-io</groupId>
229229
<artifactId>commons-io</artifactId>
230-
<version>2.16.1</version>
230+
<version>2.18.0</version>
231231
<scope>test</scope>
232232
</dependency>
233233

@@ -239,7 +239,7 @@
239239
</dependencies>
240240

241241
<properties>
242-
<nashorn.version>15.4</nashorn.version>
242+
<nashorn.version>15.6</nashorn.version>
243243
</properties>
244244

245245
<profiles>

handlebars/src/test/java/com/github/jknack/handlebars/AbstractTest.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ public void shouldCompileTo(final String template, final String data, final Stri
3434
shouldCompileTo(template, data, expected, "");
3535
}
3636

37+
/**
38+
* Normalizes spaces in the result and compares it with the expected value.
39+
*
40+
* @param template The template to compile.
41+
* @param data The context to apply.
42+
* @param expected The expected result.
43+
* @throws IOException If an I/O error occurs.
44+
*/
45+
public void shouldCompileToNormalized(final String template, final Object data, final String expected)
46+
throws IOException {
47+
shouldCompileToNormalized(template, data, new Hash(), new Hash(), expected, "");
48+
}
49+
3750
public void shouldCompileTo(final String template, final Object data, final String expected)
3851
throws IOException {
3952
shouldCompileTo(template, data, expected, "");
@@ -120,6 +133,41 @@ public void shouldCompileTo(
120133
assertEquals(expected, result, "'" + expected + "' should === '" + result + "': " + message);
121134
}
122135

136+
/*
137+
* Normalizes spaces in the result and compares it with the expected value.
138+
*
139+
* @param template The template to compile.
140+
* @param context The context to apply.
141+
* @param helpers The helpers to use.
142+
* @param partials The partials to use.
143+
* @param expected The expected result.
144+
* @param message The message to display on failure.
145+
* @throws IOException If an I/O error occurs.
146+
*/
147+
public void shouldCompileToNormalized(
148+
final String template,
149+
final Object context,
150+
final Hash helpers,
151+
final Hash partials,
152+
final String expected,
153+
final String message)
154+
throws IOException {
155+
Template t = compile(template, helpers, partials);
156+
String result = t.apply(configureContext(context));
157+
assertEquals(expected, normalizeSpaces(result), "'" + expected + "' should === '" + result + "': " + message);
158+
}
159+
160+
/**
161+
* Helper to normalize narrow no-break space (U+202F) and regular non-breaking space (U+00A0)
162+
* characters to regular space (U+0020).
163+
*/
164+
public String normalizeSpaces(String input) {
165+
return input.replace('\u202F', ' ')
166+
.replace('\u00A0', ' ')
167+
.replaceAll("\\s+", " ") // optional: also collapses multiple spaces
168+
.trim();
169+
}
170+
123171
protected Object configureContext(final Object context) {
124172
return context;
125173
}

pom.xml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@
6464
<dependency>
6565
<groupId>org.apache.commons</groupId>
6666
<artifactId>commons-lang3</artifactId>
67-
<version>3.14.0</version>
67+
<version>3.17.0</version>
6868
</dependency>
6969

7070
<dependency>
7171
<groupId>org.apache.commons</groupId>
7272
<artifactId>commons-text</artifactId>
73-
<version>1.12.0</version>
73+
<version>1.13.0</version>
7474
</dependency>
7575

7676
<dependency>
@@ -89,7 +89,7 @@
8989
<dependency>
9090
<groupId>org.slf4j</groupId>
9191
<artifactId>slf4j-api</artifactId>
92-
<version>2.0.13</version>
92+
<version>2.0.17</version>
9393
</dependency>
9494

9595
<!-- Servlet API -->
@@ -111,7 +111,7 @@
111111
<dependency>
112112
<groupId>ch.qos.logback</groupId>
113113
<artifactId>logback-classic</artifactId>
114-
<version>1.5.6</version>
114+
<version>1.5.18</version>
115115
</dependency>
116116

117117
<dependency>
@@ -135,13 +135,13 @@
135135
<dependency>
136136
<groupId>org.yaml</groupId>
137137
<artifactId>snakeyaml</artifactId>
138-
<version>2.2</version>
138+
<version>2.4</version>
139139
</dependency>
140140

141141
<dependency>
142142
<groupId>org.hamcrest</groupId>
143143
<artifactId>hamcrest</artifactId>
144-
<version>2.2</version>
144+
<version>3.0</version>
145145
</dependency>
146146

147147
<dependency>
@@ -156,7 +156,7 @@
156156
<plugins>
157157
<plugin>
158158
<artifactId>maven-compiler-plugin</artifactId>
159-
<version>3.13.0</version>
159+
<version>3.14.0</version>
160160
</plugin>
161161

162162
<plugin>
@@ -168,7 +168,7 @@
168168
<plugin>
169169
<groupId>org.apache.maven.plugins</groupId>
170170
<artifactId>maven-javadoc-plugin</artifactId>
171-
<version>3.7.0</version>
171+
<version>3.11.2</version>
172172
<configuration>
173173
<excludePackageNames>com.github.jknack.handlebars.internal.*</excludePackageNames>
174174
<show>public</show>
@@ -189,7 +189,7 @@
189189
<plugin>
190190
<groupId>org.apache.maven.plugins</groupId>
191191
<artifactId>maven-surefire-plugin</artifactId>
192-
<version>3.3.0</version>
192+
<version>3.5.3</version>
193193
<configuration>
194194
<!-- set default locale of the test JVM to en_US because some tests expect e.g. the dollar sign as currency symbol -->
195195
<argLine>-Duser.language=en -Duser.country=US</argLine>
@@ -214,7 +214,7 @@
214214
<plugin>
215215
<groupId>com.diffplug.spotless</groupId>
216216
<artifactId>spotless-maven-plugin</artifactId>
217-
<version>2.43.0</version>
217+
<version>2.44.4</version>
218218
<configuration>
219219
<upToDateChecking>
220220
<enabled>true</enabled>
@@ -260,7 +260,7 @@
260260
<plugin>
261261
<groupId>org.apache.maven.plugins</groupId>
262262
<artifactId>maven-surefire-plugin</artifactId>
263-
<version>3.3.0</version>
263+
<version>3.5.3</version>
264264
<inherited>false</inherited>
265265
<configuration>
266266
<includes>
@@ -290,7 +290,7 @@
290290
<plugin>
291291
<groupId>org.codehaus.mojo</groupId>
292292
<artifactId>exec-maven-plugin</artifactId>
293-
<version>3.3.0</version>
293+
<version>3.5.0</version>
294294
<executions>
295295
<execution>
296296
<phase>initialize</phase>
@@ -393,7 +393,7 @@
393393
<plugin>
394394
<groupId>org.apache.maven.plugins</groupId>
395395
<artifactId>maven-gpg-plugin</artifactId>
396-
<version>3.2.4</version>
396+
<version>3.2.7</version>
397397
<executions>
398398
<execution>
399399
<id>sign-artifacts</id>
@@ -494,20 +494,20 @@
494494
<properties>
495495
<!-- Encoding UTF-8 -->
496496
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
497-
<jackson2-version>2.17.1</jackson2-version>
498-
<spring.version>6.1.10</spring.version>
499-
<jacoco.version>0.8.12</jacoco.version>
500-
<antlr-version>4.13.1</antlr-version>
501-
<mockito.version>5.12.0</mockito.version>
497+
<jackson2-version>2.18.3</jackson2-version>
498+
<spring.version>6.2.5</spring.version>
499+
<jacoco.version>0.8.13</jacoco.version>
500+
<antlr-version>4.13.2</antlr-version>
501+
<mockito.version>5.17.0</mockito.version>
502502
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssa</maven.build.timestamp.format>
503503
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
504504
<timestamp>${maven.build.timestamp}</timestamp>
505-
<maven.compiler.source>17</maven.compiler.source>
506-
<maven.compiler.target>17</maven.compiler.target>
507-
<maven.compiler.release>17</maven.compiler.release>
505+
<maven.compiler.source>21</maven.compiler.source>
506+
<maven.compiler.target>21</maven.compiler.target>
507+
<maven.compiler.release>21</maven.compiler.release>
508508
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
509509
<pre-commit-hook>src${file.separator}etc${file.separator}formatter.sh</pre-commit-hook>
510510
<mustache-specs>handlebars${file.separator}src${file.separator}test${file.separator}resources${file.separator}mustache</mustache-specs>
511-
<junit.version>5.10.3</junit.version>
511+
<junit.version>5.12.1</junit.version>
512512
</properties>
513513
</project>

tests/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<dependency>
3434
<groupId>joda-time</groupId>
3535
<artifactId>joda-time</artifactId>
36-
<version>2.12.7</version>
36+
<version>2.14.0</version>
3737
</dependency>
3838

3939
<!-- Test dependencies -->
@@ -75,7 +75,7 @@
7575
<plugin>
7676
<groupId>org.apache.maven.plugins</groupId>
7777
<artifactId>maven-surefire-plugin</artifactId>
78-
<version>3.3.0</version>
78+
<version>3.5.3</version>
7979
<configuration>
8080
<!-- set default locale of the test JVM to en_US because some tests expect e.g. the dollar sign as currency symbol -->
8181
<argLine>-Duser.language=en -Duser.country=US</argLine>
@@ -95,7 +95,7 @@
9595
<plugin>
9696
<groupId>org.apache.maven.plugins</groupId>
9797
<artifactId>maven-deploy-plugin</artifactId>
98-
<version>3.1.2</version>
98+
<version>3.1.4</version>
9999
<configuration>
100100
<skip>true</skip>
101101
</configuration>

tests/src/test/java/com/github/jknack/handlebars/helper/ext/JodaHelperTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ public void testStyle() throws IOException {
6060
version -> version <= 8,
6161
() -> shouldCompileTo("{{jodaStyleHelper this \"SS\"}}", dateTime, "7/4/95 2:32 PM"));
6262
withJava(
63-
version -> version >= 9,
63+
version -> version >= 9 && version <= 20,
6464
() -> shouldCompileTo("{{jodaStyleHelper this \"SS\"}}", dateTime, "7/4/95, 2:32 PM"));
65+
withJava(
66+
version -> version >= 21,
67+
() -> shouldCompileToNormalized("{{jodaStyleHelper this \"SS\"}}", dateTime, "7/4/95, 2:32 PM"));
6568
}
6669

6770
@Test

0 commit comments

Comments
 (0)