Skip to content

Commit 71a1958

Browse files
committed
Make sure no extra line breaks are introduced
1 parent 6b249f9 commit 71a1958

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<artifactId>jhlite-test-maven-project</artifactId>
6+
<version>0.0.1</version>
7+
<name>Test project</name>
8+
<packaging>pom</packaging>
9+
10+
<properties>
11+
<json-web-token.version>0.11.5</json-web-token.version>
12+
<logstash-logback-encoder.version>7.2</logstash-logback-encoder.version>
13+
<spring-boot.version>2.7.1</spring-boot.version>
14+
</properties>
15+
16+
<dependencyManagement>
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.springdoc</groupId>
20+
<artifactId>springdoc-openapi-ui</artifactId>
21+
<version>${springdoc-openapi.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.springframework.boot</groupId>
25+
<artifactId>spring-boot-dependencies</artifactId>
26+
<version>${spring-boot.version}</version>
27+
<scope>import</scope>
28+
<type>pom</type>
29+
30+
</dependency>
31+
32+
</dependencies>
33+
</dependencyManagement>
34+
35+
<dependencies>
36+
<dependency>
37+
<groupId>net.logstash.logback</groupId>
38+
<artifactId>logstash-logback-encoder</artifactId>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>io.jsonwebtoken</groupId>
43+
<artifactId>jjwt-api</artifactId>
44+
<version>${json-web-token.version}</version>
45+
<classifier>classif</classifier>
46+
<scope>test</scope>
47+
<optional>true</optional>
48+
</dependency>
49+
</dependencies>
50+
51+
<build>
52+
<plugins>
53+
<plugin>
54+
<groupId>org.springframework.boot</groupId>
55+
<artifactId>spring-boot-maven-plugin</artifactId>
56+
</plugin>
57+
</plugins>
58+
<pluginManagement>
59+
<plugins>
60+
<plugin>
61+
<groupId>org.springframework.boot</groupId>
62+
<artifactId>spring-boot-maven-plugin</artifactId>
63+
<version>${spring-boot.version}</version>
64+
<executions>
65+
<execution>
66+
<goals>
67+
<goal>repackage</goal>
68+
</goals>
69+
</execution>
70+
</executions>
71+
<configuration>
72+
<mainClass>${start-class}</mainClass>
73+
</configuration>
74+
</plugin>
75+
</plugins>
76+
</pluginManagement>
77+
</build>
78+
</project>

src/test/java/io/fabric8/maven/MavenTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,13 @@ void should_write_attributes() throws Exception {
333333
Approvals.verify(sw.toString());
334334
}
335335

336+
@Test
337+
void should_not_add_extra_line_break() throws Exception {
338+
Path pom = Paths.get(getClass().getResource("extra-line-pom.xml").toURI());
339+
Model model = Maven.readModel(pom);
340+
StringWriter sw = new StringWriter();
341+
Maven.writeModel(model, sw);
342+
Approvals.verify(sw.toString());
343+
}
344+
336345
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<artifactId>jhlite-test-maven-project</artifactId>
6+
<version>0.0.1</version>
7+
<name>Test project</name>
8+
<packaging>pom</packaging>
9+
10+
<properties>
11+
<json-web-token.version>0.11.5</json-web-token.version>
12+
<logstash-logback-encoder.version>7.2</logstash-logback-encoder.version>
13+
<spring-boot.version>2.7.1</spring-boot.version>
14+
</properties>
15+
16+
<dependencyManagement>
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.springdoc</groupId>
20+
<artifactId>springdoc-openapi-ui</artifactId>
21+
<version>${springdoc-openapi.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.springframework.boot</groupId>
25+
<artifactId>spring-boot-dependencies</artifactId>
26+
<version>${spring-boot.version}</version>
27+
<scope>import</scope>
28+
<type>pom</type>
29+
30+
</dependency>
31+
32+
</dependencies>
33+
</dependencyManagement>
34+
35+
<dependencies>
36+
<dependency>
37+
<groupId>net.logstash.logback</groupId>
38+
<artifactId>logstash-logback-encoder</artifactId>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>io.jsonwebtoken</groupId>
43+
<artifactId>jjwt-api</artifactId>
44+
<version>${json-web-token.version}</version>
45+
<classifier>classif</classifier>
46+
<scope>test</scope>
47+
<optional>true</optional>
48+
</dependency>
49+
</dependencies>
50+
51+
<build>
52+
<plugins>
53+
<plugin>
54+
<groupId>org.springframework.boot</groupId>
55+
<artifactId>spring-boot-maven-plugin</artifactId>
56+
</plugin>
57+
</plugins>
58+
<pluginManagement>
59+
<plugins>
60+
<plugin>
61+
<groupId>org.springframework.boot</groupId>
62+
<artifactId>spring-boot-maven-plugin</artifactId>
63+
<version>${spring-boot.version}</version>
64+
<executions>
65+
<execution>
66+
<goals>
67+
<goal>repackage</goal>
68+
</goals>
69+
</execution>
70+
</executions>
71+
<configuration>
72+
<mainClass>${start-class}</mainClass>
73+
</configuration>
74+
</plugin>
75+
</plugins>
76+
</pluginManagement>
77+
</build>
78+
</project>

0 commit comments

Comments
 (0)