Skip to content

Commit d31a340

Browse files
committed
Add support for generation of multi-line YAML resources
This PR upgrade com.fasterxml.jackson.dataformat:jackson-dataformat-yaml to version 2.8.4 which contains the bugfix FasterXML/jackson-dataformat-yaml#78 for not unquoting strings which contain boolean values. When 2.9 is out then this should be taken along with the then new feature LITERAL_BLOCK_STYLE (instead of MINIMIZE_QUOTES). See FasterXML/jackson-dataformat-yaml#76 for details.
1 parent bbd3c3d commit d31a340

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

core/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
<artifactId>kubernetes-api</artifactId>
4949
</dependency>
5050

51+
<dependency>
52+
<groupId>com.fasterxml.jackson.dataformat</groupId>
53+
<artifactId>jackson-dataformat-yaml</artifactId>
54+
</dependency>
55+
5156
<dependency>
5257
<groupId>io.fabric8</groupId>
5358
<artifactId>docker-maven-plugin</artifactId>

core/src/main/java/io/fabric8/maven/core/util/ResourceFileType.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919
import java.io.File;
2020

21+
import com.fasterxml.jackson.core.JsonParser;
2122
import com.fasterxml.jackson.databind.ObjectMapper;
2223
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
24+
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
2325

2426
/**
2527
* Type of resources supported
@@ -39,7 +41,8 @@ public ObjectMapper getObjectMapper() {
3941
yaml("yml","yml") {
4042
@Override
4143
public ObjectMapper getObjectMapper() {
42-
return new ObjectMapper(new YAMLFactory());
44+
return new ObjectMapper(new YAMLFactory()
45+
.configure(YAMLGenerator.Feature.MINIMIZE_QUOTES, true));
4346
}
4447
};
4548

parent/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,20 @@
216216
<groupId>io.fabric8</groupId>
217217
<artifactId>kubernetes-api</artifactId>
218218
<version>${version.fabric8}</version>
219+
<exclusions>
220+
<exclusion>
221+
<groupId>com.fasterxml.jackson.dataformat</groupId>
222+
<artifactId>jackson-dataformat-yaml</artifactId>
223+
</exclusion>
224+
</exclusions>
219225
</dependency>
226+
227+
<dependency>
228+
<groupId>com.fasterxml.jackson.dataformat</groupId>
229+
<artifactId>jackson-dataformat-yaml</artifactId>
230+
<version>2.8.4</version>
231+
</dependency>
232+
220233
<dependency>
221234
<groupId>io.fabric8</groupId>
222235
<artifactId>fabric8-project-utils</artifactId>

0 commit comments

Comments
 (0)