GWT2.5 maven插件在Linux中为i18n生成抛出错误
GWT2.5 maven插件在Linux中为i18n生成抛出错误,但在Windows中工作完美。 我尝试使用-X选项运行,但在日志中找不到任何有用的错误描述GWT2.5 maven插件在Linux中为i18n生成抛出错误,gwt,Gwt,GWT2.5 maven插件在Linux中为i18n生成抛出错误,但在Windows中工作完美。 我尝试使用-X选项运行,但在日志中找不到任何有用的错误描述 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <v
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.version}</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>generateAsync</goal>
<goal>i18n</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${project.build.directory}/${project.build.finalName}/cms</webappDirectory>
<hostedWebapp>target/${project.artifactId}</hostedWebapp>
<i18nMessagesBundles>
<i18nMessagesBundle>package.module1.client.Messages</i18nMessagesBundle>
<i18nMessagesBundle>package.module2.client.Messages</i18nMessagesBundle>
<i18nMessagesBundle>package.module3.client.Messages</i18nMessagesBundle>
</i18nMessagesBundles>
<modules>
<module>package.module1.Module1</module>
<module>package.module2.Module2</module>
<module>package.module3.Module3</module>
</modules>
</configuration>
</plugin>
org.codehaus.mojo
[错误]
[错误]纠正问题后,可以使用命令恢复生成
[错误]mvn-rf:应用程序
alex@alex-个人电脑:~/development/comomile/svn$
我在调试后找到了解决方案
解决方案是使用大写首字母创建包含消息的属性文件:例如“messages.properties”而不是“messages.properties”
问题在于Linux对文件名是区分大小写的,这就是为什么发布此代码段的原因:
String resourcePath = className.replace('.', '/') + ".properties";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = ClassLoader.getSystemClassLoader();
}
URL r = cl.getResource(resourcePath);
if (r == null) {
throw new FileNotFoundException("Could not find the resource '"
+ resourcePath + " matching '" + className
+ "' did you remember to add it to your classpath?");
}
在com.google.gwt.i18n.tools.I18NSync:326.中,你说“…抛出错误…”。在你的问题中包含这些错误,这样人们可以帮助你。好吧,我会附加它们,但它们没有意义,正如我在这里写的那样…它们可能对你没有意义,但希望它们对其他人有意义,从而能够帮助你。看起来我需要调试插件…我为此创建了插件