cod*_*joe 11 maven-2 utf-8 maven-plugin maven-3 maven
我正在使用maven-resources-plugin从我的项目中复制一些资源,但我的一个资源是二进制文件.输出说这是Using 'UTF-8' encoding to copy filtered resources我的问题!
这是我的插件配置.
        <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>
我可以跳过二进制文件的UTF-8转换吗?
谢谢.
cod*_*joe 19
好吧,为了解决我的问题,我将其添加到我的配置maven二进制过滤:
<nonFilteredFileExtensions>                            
    <nonFilteredFileExtension>dcm</nonFilteredFileExtension>
</nonFilteredFileExtensions>
设置两个单独的<resource>元素,一个使用<filtering>false</filtering>,另一个使用<filtering>true</filtering>。使用<includes>和<excludes>元素<resource>按扩展名从其中之一中排除二进制文件。
然而,默认情况下资源插件在排除例如图像方面变得更加智能,因此请确保您使用最新版本。