[MNG-7763] Provide UTF-8 as a default value for project.build.sourceEncoding and project.reporting.outputEncoding (#1085)

This commit is contained in:
Guillaume Nodet 2023-04-17 15:20:54 +02:00 committed by GitHub
parent 0a67219271
commit 9e51a8fe95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -1219,7 +1219,7 @@ class PomConstructionTest {
@Test
void testPropertiesNoDuplication() throws Exception {
PomTestWrapper pom = buildPom("properties-no-duplication/sub");
assertEquals(1, ((Properties) pom.getValue("properties")).size());
assertEquals(3, ((Properties) pom.getValue("properties")).size());
assertEquals("child", pom.getValue("properties/pomProfile"));
}
@ -1342,8 +1342,10 @@ class PomConstructionTest {
assertEquals(1, ((List<?>) pom.getValue("modules")).size());
assertEquals("sub", pom.getValue("modules[1]"));
assertEquals(1, ((Map<?, ?>) pom.getValue("properties")).size());
assertEquals(3, ((Map<?, ?>) pom.getValue("properties")).size());
assertEquals("project-property", pom.getValue("properties[1]/itProperty"));
assertEquals("UTF-8", pom.getValue("properties[1]/project.build.sourceEncoding"));
assertEquals("UTF-8", pom.getValue("properties[1]/project.reporting.outputEncoding"));
assertEquals(1, ((List<?>) pom.getValue("dependencyManagement/dependencies")).size());
assertEquals("org.apache.maven.its", pom.getValue("dependencyManagement/dependencies[1]/groupId"));

View File

@ -23,6 +23,11 @@ under the License.
<project>
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<repositories>
<repository>
<id>central</id>

View File

@ -225,11 +225,13 @@ Maven Model Builder
* <<<$\{project.build.sourceEncoding\}>>> for
{{{https://cwiki.apache.org/confluence/display/MAVEN/POM+Element+for+Source+File+Encoding}source files encoding}}
(defaults to platform encoding)
(defaults to <<<UTF-8>>> since Maven 4.0.0, no default value was provided in Maven 3.x, meaning that the platform
encoding was used by plugins)
* <<<$\{project.reporting.outputEncoding\}>>> for
{{{https://cwiki.apache.org/confluence/display/MAVENOLD/Reporting+Encoding+Configuration}reporting output files encoding}}
(defaults to <<<UTF-8>>>)
(defaults to <<<UTF-8>>> since Maven 4.0.0, no default value was provided in Maven 3.x, plugins usually defaulting
to <<<UTF-8>>>)
[]