Maven and non-Latin characters in file names

Viewed 306

I have a Maven/Spring Boot project and resource folder with a mix of files with Latin and non Latin characters.

This is my pom.xml:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <parent>
        <artifactId>example</artifactId>
        <groupId>com.example</groupId>
        <version>0.0.1</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>api</artifactId>
    <packaging>war</packaging>

    <properties>
        <java.source.version>1.8</java.source.version>
        <java.target.version>1.8</java.target.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding
    </properties>

    <build>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>${project.basedir}/src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>${project.basedir}/src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <addResources>false</addResources>
                    <jvmArguments>
                        -Xdebug
                        -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
                    </jvmArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.source.version}</source>
                    <target>${java.target.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <useDefaultDelimiters>true</useDefaultDelimiters>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Right now on the Linux(OpenSuse) machine after the Maven build(on Jenkins) I have two WAR files:

api-0.0.1.war.original 
api-0.0.1.war 

After unzipping of api-0.0.1.war.original everything looks good but in case of unzipping api-0.0.1.war all non-Latin characters in file names look like ??????. I noticed this after deploying my application to Tomcat.

What can be wrong and how to make it properly working with api-0.0.1.war also ?

UPDATED

As it was suggested at the comment, I have created a sample GitHub project that helps to reproduce the issue: Spring Boot Maven non-Latin characters in file names issue

The steps to reproduce:

  1. Build project: mvn clean install
  2. Deploy demo-0.0.1-SNAPSHOT.war to Tomcat 8 at OpenSuse

After deploy you will see the following issue with a file name:

enter image description here

0 Answers
Related