mojohaus / buildnumber-maven-plugin

BuildNumber Maven Plugin
https://www.mojohaus.org/buildnumber-maven-plugin/
MIT License
66 stars 57 forks source link

Goal "create-timestamp" sets corrupt german special character in month with German characters #217

Open zamani84 opened 7 months ago

zamani84 commented 7 months ago

Hallo,

when using the timestamp property (see below for complete configuration), then for some months the result is corrupt. For example, at the moment the German month is called "März" (march), the result then with the plugin is "26.März.2024 18:01". As you see the plugin is has problem to write the special character in the month name properly. This is the plugin configuration:

<project ..>
.....
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.encoding>${project.build.sourceEncoding}</maven.compiler.encoding>
    <maven.resources.encoding>${project.build.sourceEncoding}</maven.resources.encoding>
</properties>
<build>
      <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <id>build.date</id>
            <phase>initialize</phase>
            <goals>
              <goal>create-timestamp</goal>
            </goals>
            <configuration>
              <timestampFormat>yyyy-MM-dd</timestampFormat>
              <timestampPropertyName>build.date</timestampPropertyName>
            </configuration>
          </execution>
          <execution>
            <id>build.time</id>
            <phase>initialize</phase>
            <goals>
              <goal>create-timestamp</goal>
            </goals>
            <configuration>
              <timestampFormat>dd.MMMM.yyyy HH:mm</timestampFormat>
              <timestampPropertyName>build.time</timestampPropertyName>
            </configuration>
          </execution>
        </executions>
      </plugin>
</plugins>
</build>
</project>

We use this plugin in version "1.4" but I also has changed it to the newest version 3.2.0 but it was the same problem.

Can you make a bugfix please?

Thank you very much and God bless you!

bmarwell commented 6 months ago

Hi, which OS are you using and did you set the build encoding in the main properties? Please show us a reproducer.

Also, please consider spending a few more seconds formatting your issue text. It was really hard to read.

zamani84 commented 6 months ago

Hi, we are using windows 10 as development environment, we have actually a utf-8 development environment. See attachment how the result is generated when I access the build date: Login 25-03-2024

The German Name of the month is "März" but the german Character "ä" is generated wrong, although it is an UTF-8 JSP page. The problem ist, that the maven plugin saves/writes this date already internaly wrong.

I have updated to initial comment so that you see all the important parts of the plugin usage/conf. We don't do anything special except then after running a web application accessing the date / time that the maven plugin has set and representing it in website. But before the website get the value to show it is already saved with wrong character. So it is not because the JSP can not show it but because it was generated wrong into the property "build.time" .