0

I'am trying to build war file for my project, that is containing russian class names. When I just run my app on development environment, it works good, but if I build that war file, all russian filenames are mangled. I cannot rename these files in the project so they could be in english. The only way out is to make my own refactoring utility for them, and run it every time these files are regenerated. So I want to know if there is a way to make maven build it with locale specific configuration. These files are having proper names while theq are on my filesystem. But theqy are changed when I look at them in war archive.

pom.xml snippet

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
                <compilerArgument>-Xlint:all</compilerArgument>
                <showWarnings>true</showWarnings>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>
5
  • "mangled". How? What exatly is the problem?
    – user1907906
    Mar 31, 2014 at 5:31
  • file name characters are changed into question marks.
    – Pavel
    Mar 31, 2014 at 5:35
  • 1) Post the relevant parts of your pom.xml. 2) Check the encoding of every file involved.
    – user1907906
    Mar 31, 2014 at 5:37
  • Seems like these files in utf8. If it was a problem I think they would havebad names even in developement environment/
    – Pavel
    Mar 31, 2014 at 5:46
  • I build the project with eclipse if it makes sense.
    – Pavel
    Mar 31, 2014 at 5:48

1 Answer 1

1

You should always fix the encoding of source files:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Also read the http://maven.apache.org/general.html#encoding-warning and How to configure encoding in Maven? for additional information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.