Skip to content

Commit 919e28a

Browse files
kwinghenzler
andauthored
Update to Snakeyaml 2.2 (#662)
This closes #660 Co-authored-by: Georg Henzler <[email protected]>
1 parent 03a4d73 commit 919e28a

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

accesscontroltool-bundle/bnd.bnd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ org.apache.sling.commons.scheduler.*;resolution:=optional,\
1616
org.apache.jackrabbit.oak.spi.security.principal;version="[1.5.0,3)",\
1717
!jakarta.servlet*,\
1818
*
19+
20+
# snakeyaml 2.0 uses multi version jars which are not supported: https://github.com/bndtools/bnd/issues/3514
21+
-fixupmessages "Classes found in the wrong directory"; restrict:=error; is:=warning

accesscontroltool-bundle/pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,18 @@
209209
<skip>false</skip><!-- only enable in specific submodules -->
210210
<suppressionFile>${project.basedir}/suppression.xml</suppressionFile>
211211
</configuration>
212-
</plugin>
212+
</plugin>
213+
<plugin>
214+
<groupId>org.jacoco</groupId>
215+
<artifactId>jacoco-maven-plugin</artifactId>
216+
<configuration>
217+
<excludes>
218+
<!-- Exclude multi-version snakeyaml for Jacoco due to https://github.com/jacoco/jacoco/issues/407 -->
219+
<exclude>snakeyaml-2.2.jar</exclude>
220+
<exclude>tomcat-*.jar</exclude>
221+
</excludes>
222+
</configuration>
223+
</plugin>
213224
</plugins>
214225
</pluginManagement>
215226
<plugins>

accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationAdminPluginScalarConstructor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.osgi.service.cm.ConfigurationPlugin;
77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
9+
import org.yaml.snakeyaml.LoaderOptions;
910
import org.yaml.snakeyaml.constructor.AbstractConstruct;
1011
import org.yaml.snakeyaml.constructor.Constructor;
1112
import org.yaml.snakeyaml.env.EnvScalarConstructor;
@@ -23,7 +24,7 @@
2324
* Usually this is called with
2425
* <a href="https://github.com/apache/felix-dev/tree/master/configadmin-plugins/interpolation">Felix Configadmin Interpolation Plugin</a>.
2526
*
26-
* @see <a href="https://bitbucket.org/asomov/snakeyaml/wiki/Variable%20substitution">Variable substitution</a>
27+
* @see <a href="https://bitbucket.org/snakeyaml/snakeyaml/wiki/Variable%20substitution">Variable substitution</a>
2728
*
2829
*/
2930
public class YamlConfigurationAdminPluginScalarConstructor extends Constructor {
@@ -37,6 +38,7 @@ public class YamlConfigurationAdminPluginScalarConstructor extends Constructor {
3738
private final InstallationLogger installLog;
3839

3940
public YamlConfigurationAdminPluginScalarConstructor(InstallationLogger installLog, ConfigurationPlugin interpolationPlugin) {
41+
super(new LoaderOptions());
4042
this.yamlConstructors.put(TAG, new ConstructYamlConfigurationAdminPlugin());
4143
this.interpolationPlugin = interpolationPlugin;
4244
this.installLog = installLog;
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3-
<suppress>
4-
<notes><![CDATA[
5-
Snakeyaml 2.0.0 is not out yet, and the yaml is only executed by admins (compare with https://bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in)
6-
]]></notes>
7-
<packageUrl regex="true">^pkg:maven/org\.yaml/snakeyaml@.*$</packageUrl>
8-
<vulnerabilityName>CVE-2022-1471</vulnerabilityName>
9-
</suppress>
103
</suppressions>

pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<dependency>
115115
<groupId>org.yaml</groupId>
116116
<artifactId>snakeyaml</artifactId>
117-
<version>1.32</version>
117+
<version>2.2</version>
118118
</dependency>
119119
<!-- due to https://bugs.openjdk.java.net/browse/JDK-8231581 OOTB JRE is not sufficient -->
120120
<dependency>
@@ -434,6 +434,11 @@
434434
<skip>true</skip><!-- only enable in specific submodules -->
435435
</configuration>
436436
</plugin>
437+
<plugin>
438+
<groupId>org.jacoco</groupId>
439+
<artifactId>jacoco-maven-plugin</artifactId>
440+
<version>0.8.8</version>
441+
</plugin>
437442
</plugins>
438443
</pluginManagement>
439444
<plugins>
@@ -671,7 +676,6 @@
671676
<plugin>
672677
<groupId>org.jacoco</groupId>
673678
<artifactId>jacoco-maven-plugin</artifactId>
674-
<version>0.8.8</version>
675679
<executions>
676680
<execution>
677681
<id>prepare-agent</id>

0 commit comments

Comments
 (0)