Skip to content

Commit

Permalink
Format existing xml templates and fix some indentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalgrimaud committed Jan 5, 2022
1 parent a827400 commit 023fc21
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static String getParent(Parent parent, int indentation) {
.append(VERSION_END)
.append(System.lineSeparator())
.append(indent(2, indentation))
.append("<relativePath/>")
.append("<relativePath />")
.append(System.lineSeparator())
.append(indent(1, indentation))
.append(PARENT_END);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private void addLoggerToConfiguration(
String needleLogger
) {
String loggerWithNeedle =
String.format("<logger name=\"%s\" level=\"%s\"/>", packageName, level.toString()) + System.lineSeparator() + needleLogger;
String.format("<logger name=\"%s\" level=\"%s\" />", packageName, level.toString()) + System.lineSeparator() + " " + needleLogger;
projectRepository.replaceText(project, getPath(folderConfig), fileLoggingConfig, needleLogger, loggerWithNeedle);
}
}
8 changes: 3 additions & 5 deletions src/main/resources/generator/buildtool/maven/pom.xml.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down Expand Up @@ -192,8 +192,7 @@
</goals>
<configuration>
<fileSets>
<fileSet
implementation="org.apache.maven.shared.model.fileset.FileSet">
<fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
<directory>${project.basedir}</directory>
<includes>
<include>**/*.exec</include>
Expand Down Expand Up @@ -243,8 +242,7 @@
<configuration>
<rules>
<requireMavenVersion>
<message>You are running an older version of Maven. JHipster requires at least Maven ${maven.version}
</message>
<message>You are running an older version of Maven. JHipster requires at least Maven ${maven.version}</message>
<version>[${maven.version},)</version>
</requireMavenVersion>
<requireJavaVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,3 @@ public class {{mainClass}}App {
return hostAddress;
}
}

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>

<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<include resource="org/springframework/boot/logging/logback/base.xml" />

<!-- The FILE and ASYNC appenders are here as examples for a production configuration -->
<!--
Expand All @@ -27,18 +26,17 @@
</root>
-->

<logger name="{{packageName}}" level="INFO"/>
<logger name="{{packageName}}" level="INFO" />

<logger name="ch.qos.logback" level="WARN"/>
<logger name="com.sun" level="WARN"/>
<logger name="org.springframework" level="WARN"/>
<logger name="ch.qos.logback" level="WARN" />
<logger name="com.sun" level="WARN" />
<logger name="org.springframework" level="WARN" />
<!-- jhipster-needle-logback-add-log -->

<!-- https://logback.qos.ch/manual/configuration.html#shutdownHook and https://jira.qos.ch/browse/LOGBACK-1090 -->
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />

<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>

</configuration>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>

<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<include resource="org/springframework/boot/logging/logback/base.xml" />

<!-- The FILE and ASYNC appenders are here as examples for a production configuration -->
<!--
Expand All @@ -27,16 +26,15 @@
</root>
-->

<logger name="{{packageName}}" level="INFO"/>
<logger name="{{packageName}}" level="INFO" />

<logger name="ch.qos.logback" level="WARN"/>
<logger name="com.sun" level="WARN"/>
<logger name="org.springframework" level="WARN"/>
<logger name="ch.qos.logback" level="WARN" />
<logger name="com.sun" level="WARN" />
<logger name="org.springframework" level="WARN" />
<!-- jhipster-needle-logback-add-log -->

<root>
<level>WARN</level>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="CONSOLE" />
</root>

</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void shouldAddParent() {
"<groupId>org.springframework.boot</groupId>",
"<artifactId>spring-boot-starter-parent</artifactId>",
"<version>2.5.3</version>",
"<relativePath/>",
"<relativePath />",
"</parent>"
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void shouldGetParent() {
" <groupId>org.springframework.boot</groupId>" + System.lineSeparator() +
" <artifactId>spring-boot-starter-parent</artifactId>" + System.lineSeparator() +
" <version>2.5.3</version>" + System.lineSeparator() +
" <relativePath/>" + System.lineSeparator() +
" <relativePath />" + System.lineSeparator() +
" </parent>";
// @formatter:on
Parent parent = Parent.builder().groupId("org.springframework.boot").artifactId("spring-boot-starter-parent").version("2.5.3").build();
Expand All @@ -37,7 +37,7 @@ void shouldGetParentWith4Indentations() {
" <groupId>org.springframework.boot</groupId>" + System.lineSeparator() +
" <artifactId>spring-boot-starter-parent</artifactId>" + System.lineSeparator() +
" <version>2.5.3</version>" + System.lineSeparator() +
" <relativePath/>" + System.lineSeparator() +
" <relativePath />" + System.lineSeparator() +
" </parent>";
// @formatter:on
Parent parent = Parent.builder().groupId("org.springframework.boot").artifactId("spring-boot-starter-parent").version("2.5.3").build();
Expand Down

0 comments on commit 023fc21

Please sign in to comment.