Choose encoding for a specific file with Maven package

Viewed 61

I would like create a package with Maven which contains a .jks certificate and this file should have a cp1252 (ANSI) encoding.

I have an assembly with my configuration files

         <fileSet>
            <outputDirectory>compjava/properties</outputDirectory>
            <directory>${basedir}/src/config</directory>
            <filtered>true</filtered>
            <includes>
                <include>truststore.jks</include>
            </includes>
        </fileSet>

And in my pom properties, I defined

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

My input certificate file is ANSI-encoded but in the package, it is UTF-8. Why?

1 Answers

I finally found the answer...

In my assembly, it is necessary to put <filtered>false<filtered> for my certificate file.

       <fileSet>
            <outputDirectory>compjava/properties</outputDirectory>
            <directory>${basedir}/src/config</directory>
            <filtered>false</filtered>
            <excludes>
                <exclude>*.properties</exclude>
                <exclude>*.template</exclude>
            </excludes>
        </fileSet>
Related