Search code examples
maven-2utf-8mavenmaven-pluginmaven-3

how to avoid UTF-8 encoding for binary with maven-resources-plugin?


I'm using the maven-resources-plugin to copy some resources from my project but one of my resources is a binary file. The output says it is Using 'UTF-8' encoding to copy filtered resources which I my problem!!!

Here is my plugin configuration.

        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.5</version>
            <executions>
                <execution>
                    <id>copy-resources</id>
                    <!-- here the phase you need -->
                    <phase>validate</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/autopublisher</outputDirectory>
                        <resources>
                            <resource>
                                <directory>src/autopublisher</directory>
                                <filtering>true</filtering>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Can I skip the UTF-8 conversion for binaries?

Thank you.


Solution

  • Well to solve my problem I added this to my configuration maven binary filtering:

    <nonFilteredFileExtensions>                            
        <nonFilteredFileExtension>dcm</nonFilteredFileExtension>
    </nonFilteredFileExtensions>