英文:
Choose encoding for a specific file with Maven package
问题
我想使用Maven创建一个包,其中包含一个.jks证书文件,该文件应该使用cp1252(ANSI)编码。
我有一个包含配置文件的装配体
<fileSet>
<outputDirectory>compjava/properties</outputDirectory>
<directory>${basedir}/src/config</directory>
<filtered>true</filtered>
<includes>
<include>truststore.jks</include>
</includes>
</fileSet>
而在我的pom属性中,我定义了
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
我的输入证书文件是ANSI编码,但在包中却是UTF-8。为什么?
英文:
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
得分: 0
我终于找到了答案...
在我的汇编中,有必要为我的证书文件放置 <filtered>false<filtered>
。
<fileSet>
<outputDirectory>compjava/properties</outputDirectory>
<directory>${basedir}/src/config</directory>
<filtered>false</filtered>
<excludes>
<exclude>*.properties</exclude>
<exclude>*.template</exclude>
</excludes>
</fileSet>
英文:
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>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论