我有 En-Jp.properties
文件,用于在日语语言环境中自动执行一些测试用例,其中英语单词作为键,日语单词 (ASCII) 作为值。
像这样:
Login:\u30ed\u30b0\u30a4\u30f3
我首先尝试使用 Java 的 native2ascii
工具来处理 2-3 个日语单词,效果很好。现在,当此文件随着键值对的 n 个数量增长时。我尝试使用 native2ascii-maven-plugin
,按照描述进行配置 here .
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
<configuration>
<src>src/main/resources</src>
<dest>target/classes</dest>
</configuration>
<executions>
<execution>
<id>native2ascii-utf8</id>
<goals>
<goal>native2ascii</goal>
</goals>
<configuration>
<encoding>UTF8</encoding>
<includes>En-jp.properties</includes>
</configuration>
</execution>
</executions>
</plugin>
但是,我遇到了以下错误,
Unable to parse configuration of mojo
org.codehaus.mojo:native2ascii-maven-plugin:1.0-beta-1:native2ascii for parameter includes: Cannot assign configuration entry 'includes' with value 'En-jp.properties' of type java.lang.String to property of type java.lang.String[]
pom.xml
中缺少什么?插件版本是否太旧,无法适应这种情况?我也怀疑我是否遵循正确的路径(使用 Maven 插件)获取整个属性文件的 ASCII 值。
最佳答案
标签<includes>
应包含元素列表,而不是单个元素。这意味着您需要添加 <include>
此标签的子标签。
应该是:
<includes>
<include>En-jp.properties</include>
</includes>
关于java - 无法为 Maven 配置 native2ascii 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33627909/