简体   繁体   English

无法为maven配置native2ascii插件

[英]Unable to configure native2ascii plugin for maven

I have En-Jp.properties file for automating some test cases in Japanese locale, which has English words as key & Japanese words (ASCII) as value. 我有En-Jp.properties文件,用于自动化日语语言环境中的一些测试用例,其中英语单词为键,日语单词(ASCII)为值。 Something like this: 像这样的东西:

Login:\u30ed\u30b0\u30a4\u30f3

I first tried with Java's native2ascii tool for 2-3 words of Japanese which is working fine. 我首先尝试使用Java的native2ascii工具来处理2-3个日语单词。 Now when this file is growing with n-number of key-value pair. 现在,当这个文件增长了n个键值对时。 I tried using native2ascii-maven-plugin , configuring as described here . 我试图用native2ascii-maven-plugin ,如描述的配置在这里

<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> 

However, I am getting below error, 但是,我收到了以下错误,

Unable to parse configuration of mojo 无法解析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[] org.codehaus.mojo:native2ascii-maven-plugin:1.0-beta-1:native2ascii for parameter包括:无法将类型为java.lang.String的值为'En-jp.properties'的配置项'includes'分配给type属性java.lang.String中[]

What is missing in pom.xml ? pom.xml缺少什么? Is the version of plugin too old to work for this scenario? 插件的版本是否太旧而无法在此方案中使用? I am also doubtful if I am following right path (using Maven plugin) for getting ASCII value for entire properties file. 我也怀疑我是否遵循正确的路径(使用Maven插件)获取整个属性文件的ASCII值。

The tag <includes> should contain a list of element, not a single element. 标签<includes>应包含元素列表,而不是单个元素。 That means you need to add <include> subtag to this tag. 这意味着您需要在此标记中添加<include>子标记。

It should be: 它应该是:

<includes>
    <include>En-jp.properties</include>
</includes>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM