validator icon indicating copy to clipboard operation
validator copied to clipboard

Maven build fails to filter app.properties due to wrong encoding

Open xxxyyyz opened this issue 8 months ago • 2 comments

Building the freshly cloned project with mvn package leads to the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources (default-resources) on project validationtool: filtering /Users/jlink/dev/projects/kosit-validator/src/main/resources/app-info.properties to /Users/jlink/dev/projects/kosit-validator/target/classes/app-info.properties failed with MalformedInputException: Input length = 1 -> [Help 1]

Seems like the filter step of files in src/main/resources fails due to wrong encoding (property files are required to be in ISO-8859-1 by JLS), but the pom.xml defines the source encoding to be UTF-8.

According to the maven-resource-plugin documentation [1], the following configuration in pom.xml resolves the issue:

             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <version>3.3.1</version>
                 <configuration>
                   <propertiesEncoding>ISO-8859-1</propertiesEncoding>
                 </configuration>
             </plugin>

[1] https://maven.apache.org/plugins/maven-resources-plugin/examples/filtering-properties-files.html

xxxyyyz avatar Apr 09 '25 08:04 xxxyyyz

Opened https://github.com/itplr-kosit/validator/pull/163

xxxyyyz avatar Apr 09 '25 09:04 xxxyyyz

Implemented in https://github.com/itplr-kosit/validator/commit/4ce8f4de58d4611bada6c0391f3cb07e1c8e2c90 - thank you

phax avatar Apr 09 '25 17:04 phax

This is also a duplicate of #146. Was fixed in 1.5.2. Thank you for pointing it out

phax avatar Sep 03 '25 15:09 phax