diff --git a/.prettierrc b/.prettierrc
index 9783c8e61c5..1c5abaa25b9 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -18,4 +18,4 @@ overrides:
tabWidth: 2
# xml rules:
-xmlWhitespaceSensitivity: ignore
\ No newline at end of file
+xmlWhitespaceSensitivity: ignore
diff --git a/src/main/java/tech/jhipster/lite/generator/buildtool/maven/domain/Maven.java b/src/main/java/tech/jhipster/lite/generator/buildtool/maven/domain/Maven.java
index 2b4b5bddc8b..3c6fba9c60d 100644
--- a/src/main/java/tech/jhipster/lite/generator/buildtool/maven/domain/Maven.java
+++ b/src/main/java/tech/jhipster/lite/generator/buildtool/maven/domain/Maven.java
@@ -90,7 +90,7 @@ public static String getParent(Parent parent, int indentation) {
.append(VERSION_END)
.append(System.lineSeparator())
.append(indent(2, indentation))
- .append("")
+ .append("")
.append(System.lineSeparator())
.append(indent(1, indentation))
.append(PARENT_END);
diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/domain/SpringBootLoggingDomainService.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/domain/SpringBootLoggingDomainService.java
index 120929e9d33..ce0b176c3dd 100644
--- a/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/domain/SpringBootLoggingDomainService.java
+++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/domain/SpringBootLoggingDomainService.java
@@ -35,7 +35,7 @@ private void addLoggerToConfiguration(
String needleLogger
) {
String loggerWithNeedle =
- String.format("", packageName, level.toString()) + System.lineSeparator() + needleLogger;
+ String.format("", packageName, level.toString()) + System.lineSeparator() + " " + needleLogger;
projectRepository.replaceText(project, getPath(folderConfig), fileLoggingConfig, needleLogger, loggerWithNeedle);
}
}
diff --git a/src/main/resources/generator/buildtool/maven/pom.xml.mustache b/src/main/resources/generator/buildtool/maven/pom.xml.mustache
index 1a0fbdbfe5b..36669d59c4e 100644
--- a/src/main/resources/generator/buildtool/maven/pom.xml.mustache
+++ b/src/main/resources/generator/buildtool/maven/pom.xml.mustache
@@ -1,7 +1,9 @@
-
-
+
+
4.0.0
{{packageName}}{{^packageName}}com.mycompany.myapp{{/packageName}}
@@ -190,8 +192,7 @@
-
+
${project.basedir}
**/*.exec
@@ -229,7 +230,7 @@
enforce-dependencyConvergence
-
+
false
@@ -241,8 +242,7 @@
- You are running an older version of Maven. JHipster requires at least Maven ${maven.version}
-
+ You are running an older version of Maven. JHipster requires at least Maven ${maven.version}
[${maven.version},)
diff --git a/src/main/resources/generator/init/.prettierrc.mustache b/src/main/resources/generator/init/.prettierrc.mustache
index dcd2665d5d7..13b5c3624df 100644
--- a/src/main/resources/generator/init/.prettierrc.mustache
+++ b/src/main/resources/generator/init/.prettierrc.mustache
@@ -16,3 +16,6 @@ overrides:
- files: "*.java"
options:
tabWidth: {{prettierDefaultIndent}}{{^prettierDefaultIndent}}2{{/prettierDefaultIndent}}
+
+# xml rules:
+xmlWhitespaceSensitivity: ignore
diff --git a/src/main/resources/generator/init/package.json.mustache b/src/main/resources/generator/init/package.json.mustache
index 81ed9cadc58..6048d39e252 100644
--- a/src/main/resources/generator/init/package.json.mustache
+++ b/src/main/resources/generator/init/package.json.mustache
@@ -6,10 +6,11 @@
"license": "UNLICENSED",
"scripts": {
"prepare": "husky install",
- "prettier:check": "prettier --check \"{,src/**/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}\"",
- "prettier:format": "prettier --write \"{,src/**/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}\""
+ "prettier:check": "prettier --check \"{,src/**/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java,xml}\"",
+ "prettier:format": "prettier --write \"{,src/**/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java,xml}\""
},
"devDependencies": {
+ "@prettier/plugin-xml": "1.2.0",
"husky": "7.0.4",
"lint-staged": "12.1.5",
"prettier": "2.5.1",
diff --git a/src/main/resources/generator/server/springboot/core/MainApp.java.mustache b/src/main/resources/generator/server/springboot/core/MainApp.java.mustache
index e3df808c6b3..292e112a4ec 100644
--- a/src/main/resources/generator/server/springboot/core/MainApp.java.mustache
+++ b/src/main/resources/generator/server/springboot/core/MainApp.java.mustache
@@ -92,4 +92,3 @@ public class {{mainClass}}App {
return hostAddress;
}
}
-
diff --git a/src/main/resources/generator/server/springboot/core/logback-spring.xml.mustache b/src/main/resources/generator/server/springboot/core/logback-spring.xml.mustache
index 4b7346267a1..45942788659 100644
--- a/src/main/resources/generator/server/springboot/core/logback-spring.xml.mustache
+++ b/src/main/resources/generator/server/springboot/core/logback-spring.xml.mustache
@@ -1,8 +1,7 @@
-
+
-
-
+
-
+
-
-
-
+
+
+
-
+
true
-
diff --git a/src/main/resources/generator/server/springboot/core/logback.xml.mustache b/src/main/resources/generator/server/springboot/core/logback.xml.mustache
index 7fcb200a444..e9d09daa704 100644
--- a/src/main/resources/generator/server/springboot/core/logback.xml.mustache
+++ b/src/main/resources/generator/server/springboot/core/logback.xml.mustache
@@ -1,8 +1,7 @@
-
+
-
-
+
-
+
-
-
-
+
+
+
WARN
-
+
-
diff --git a/src/test/java/tech/jhipster/lite/generator/buildtool/maven/application/MavenApplicationServiceIT.java b/src/test/java/tech/jhipster/lite/generator/buildtool/maven/application/MavenApplicationServiceIT.java
index efb04b96431..12573cfd695 100644
--- a/src/test/java/tech/jhipster/lite/generator/buildtool/maven/application/MavenApplicationServiceIT.java
+++ b/src/test/java/tech/jhipster/lite/generator/buildtool/maven/application/MavenApplicationServiceIT.java
@@ -38,7 +38,7 @@ void shouldAddParent() {
"org.springframework.boot",
"spring-boot-starter-parent",
"2.5.3",
- "",
+ "",
""
)
);
diff --git a/src/test/java/tech/jhipster/lite/generator/buildtool/maven/domain/maven/MavenTest.java b/src/test/java/tech/jhipster/lite/generator/buildtool/maven/domain/maven/MavenTest.java
index 967ac1f1e6b..b1195a549d2 100644
--- a/src/test/java/tech/jhipster/lite/generator/buildtool/maven/domain/maven/MavenTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/buildtool/maven/domain/maven/MavenTest.java
@@ -21,7 +21,7 @@ void shouldGetParent() {
" org.springframework.boot" + System.lineSeparator() +
" spring-boot-starter-parent" + System.lineSeparator() +
" 2.5.3" + System.lineSeparator() +
- " " + System.lineSeparator() +
+ " " + System.lineSeparator() +
" ";
// @formatter:on
Parent parent = Parent.builder().groupId("org.springframework.boot").artifactId("spring-boot-starter-parent").version("2.5.3").build();
@@ -37,7 +37,7 @@ void shouldGetParentWith4Indentations() {
" org.springframework.boot" + System.lineSeparator() +
" spring-boot-starter-parent" + System.lineSeparator() +
" 2.5.3" + System.lineSeparator() +
- " " + System.lineSeparator() +
+ " " + System.lineSeparator() +
" ";
// @formatter:on
Parent parent = Parent.builder().groupId("org.springframework.boot").artifactId("spring-boot-starter-parent").version("2.5.3").build();
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/application/MySQLApplicationServiceIT.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/application/MySQLApplicationServiceIT.java
index a2d91928201..c9376e31760 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/application/MySQLApplicationServiceIT.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/mysql/application/MySQLApplicationServiceIT.java
@@ -194,9 +194,9 @@ private void assertLoggerInConfig(Project project) {
project,
getPath(MAIN_RESOURCES, LOGGING_CONFIGURATION),
List.of(
- "",
- "",
- ""
+ "",
+ "",
+ ""
)
);
@@ -204,11 +204,11 @@ private void assertLoggerInConfig(Project project) {
project,
getPath(TEST_RESOURCES, LOGGING_TEST_CONFIGURATION),
List.of(
- "",
- "",
- "",
- "",
- ""
+ "",
+ "",
+ "",
+ "",
+ ""
)
);
}
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/application/PostgresqlApplicationServiceIT.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/application/PostgresqlApplicationServiceIT.java
index 3cc3ec5b676..dbc41f3b9d8 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/application/PostgresqlApplicationServiceIT.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/application/PostgresqlApplicationServiceIT.java
@@ -210,10 +210,10 @@ private void assertLoggerInConfig(Project project) {
project,
getPath(MAIN_RESOURCES, LOGGING_CONFIGURATION),
List.of(
- "",
- "",
- "",
- ""
+ "",
+ "",
+ "",
+ ""
)
);
@@ -221,12 +221,12 @@ private void assertLoggerInConfig(Project project) {
project,
getPath(TEST_RESOURCES, LOGGING_TEST_CONFIGURATION),
List.of(
- "",
- "",
- "",
- "",
- "",
- ""
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
)
);
}
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/application/LiquibaseApplicationServiceIT.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/application/LiquibaseApplicationServiceIT.java
index df7b0f97022..01c56bd19e9 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/application/LiquibaseApplicationServiceIT.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/application/LiquibaseApplicationServiceIT.java
@@ -154,16 +154,16 @@ private void assertLoggerInConfig(Project project) {
assertFileContent(
project,
getPath(MAIN_RESOURCES, LOGGING_CONFIGURATION),
- List.of("", "")
+ List.of("", "")
);
assertFileContent(
project,
getPath(TEST_RESOURCES, LOGGING_TEST_CONFIGURATION),
List.of(
- "",
- "",
- ""
+ "",
+ "",
+ ""
)
);
}
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/application/SpringBootLoggingApplicationServiceIT.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/application/SpringBootLoggingApplicationServiceIT.java
index 8ccd0b113e6..33a8d507d2f 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/application/SpringBootLoggingApplicationServiceIT.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/logging/application/SpringBootLoggingApplicationServiceIT.java
@@ -37,7 +37,7 @@ void shouldAddLoggerWithLevel() {
service.addLogger(project, "tech.jhipster.web", Level.DEBUG);
String applicationProperties = getPath(MAIN_RESOURCES, "logback-spring.xml");
- assertFileContent(project, applicationProperties, "");
+ assertFileContent(project, applicationProperties, "");
assertFileContent(project, applicationProperties, "");
}
}
@@ -60,7 +60,7 @@ void shouldAddLoggerWithLevel() {
service.addLoggerTest(project, "tech.jhipster.web", Level.DEBUG);
String applicationProperties = getPath(TEST_RESOURCES, "logback.xml");
- assertFileContent(project, applicationProperties, "");
+ assertFileContent(project, applicationProperties, "");
assertFileContent(project, applicationProperties, "");
}
}
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/web/application/SpringBootMvcApplicationServiceIT.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/web/application/SpringBootMvcApplicationServiceIT.java
index cf5d8803a3d..ddc449f84f6 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/web/application/SpringBootMvcApplicationServiceIT.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/mvc/web/application/SpringBootMvcApplicationServiceIT.java
@@ -43,7 +43,7 @@ void shouldInit() {
assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
- assertLoggingConfiguration(project, "");
+ assertLoggingConfiguration(project, "");
assertTestUtil(project);
assertExceptionHandler(project);
@@ -62,7 +62,7 @@ void shouldAddSpringBootMvc() {
assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
- assertLoggingConfiguration(project, "");
+ assertLoggingConfiguration(project, "");
assertTestUtil(project);
assertExceptionHandler(project);
@@ -82,7 +82,7 @@ void shouldAddSpringBootMvcWithServerPort() {
assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=7419");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
- assertLoggingConfiguration(project, "");
+ assertLoggingConfiguration(project, "");
assertTestUtil(project);
assertExceptionHandler(project);
@@ -102,7 +102,7 @@ void shouldAddSpringBootMvcWithInvalidServerPort() {
assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
- assertLoggingConfiguration(project, "");
+ assertLoggingConfiguration(project, "");
assertTestUtil(project);
assertExceptionHandler(project);
@@ -121,7 +121,7 @@ void shouldAddSpringBootUndertow() {
assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
- assertLoggingConfiguration(project, "");
+ assertLoggingConfiguration(project, "");
assertTestUtil(project);
assertExceptionHandler(project);
@@ -141,7 +141,7 @@ void shouldAddSpringBootUndertowWithServerPort() {
assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=1664");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
- assertLoggingConfiguration(project, "");
+ assertLoggingConfiguration(project, "");
assertTestUtil(project);
assertExceptionHandler(project);