mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Upgrade to SnakeYAML 2.0
Closes gh-35982
This commit is contained in:
parent
a94ac2fb44
commit
1f9ce508f7
@ -1375,7 +1375,7 @@ bom {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
library("SnakeYAML", "1.33") {
|
library("SnakeYAML", "2.0") {
|
||||||
group("org.yaml") {
|
group("org.yaml") {
|
||||||
modules = [
|
modules = [
|
||||||
"snakeyaml"
|
"snakeyaml"
|
||||||
|
@ -17,6 +17,17 @@ configurations {
|
|||||||
remoteSpringApplicationExample
|
remoteSpringApplicationExample
|
||||||
springApplicationExample
|
springApplicationExample
|
||||||
testSlices
|
testSlices
|
||||||
|
asciidoctorExtensions {
|
||||||
|
resolutionStrategy {
|
||||||
|
eachDependency { dependency ->
|
||||||
|
// Downgrade SnakeYAML as Asciidoctor fails due to an incompatibility
|
||||||
|
// in the Pysch gem
|
||||||
|
if (dependency.requested.group.equals("org.yaml")) {
|
||||||
|
dependency.useVersion("1.33")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
@ -23,7 +23,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.yaml.snakeyaml.constructor.ConstructorException;
|
import org.yaml.snakeyaml.composer.ComposerException;
|
||||||
|
|
||||||
import org.springframework.boot.origin.OriginTrackedValue;
|
import org.springframework.boot.origin.OriginTrackedValue;
|
||||||
import org.springframework.boot.origin.TextResourceOrigin;
|
import org.springframework.boot.origin.TextResourceOrigin;
|
||||||
@ -134,7 +134,7 @@ class OriginTrackedYamlLoaderTests {
|
|||||||
String yaml = "value: !!java.net.URL [!!java.lang.String [!!java.lang.StringBuilder [\"http://localhost:9000/\"]]]";
|
String yaml = "value: !!java.net.URL [!!java.lang.String [!!java.lang.StringBuilder [\"http://localhost:9000/\"]]]";
|
||||||
Resource resource = new ByteArrayResource(yaml.getBytes(StandardCharsets.UTF_8));
|
Resource resource = new ByteArrayResource(yaml.getBytes(StandardCharsets.UTF_8));
|
||||||
this.loader = new OriginTrackedYamlLoader(resource);
|
this.loader = new OriginTrackedYamlLoader(resource);
|
||||||
assertThatExceptionOfType(ConstructorException.class).isThrownBy(this.loader::load);
|
assertThatExceptionOfType(ComposerException.class).isThrownBy(this.loader::load);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.springframework.boot.env;
|
|
||||||
|
|
||||||
import org.springframework.boot.testsupport.classpath.ClassPathOverrides;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link YamlPropertySourceLoader} with SnakeYAML 2.0.
|
|
||||||
*
|
|
||||||
* @author Andy Wilkinson
|
|
||||||
*/
|
|
||||||
@ClassPathOverrides("org.yaml:snakeyaml:2.0")
|
|
||||||
class YamlPropertySourceLoaderSnakeYaml20Tests extends YamlPropertySourceLoaderTests {
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user