2013-08-17 33 views
3

GWT 2.5 maven插件在Linux中引发国际代错误,但在Windows中完美运行。 我试着用-X选项运行,但在日志中没有找到任何有用的错误描述。GWT 2.5 maven插件在Linux中引发国际代错误

  <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.apache.maven.lifecycle.LifecycleExecutionException:未能执行目标org.codehaus.mojo:GWT-Maven的插件:2.5.1:国际化(默认)在项目应用程序上:命令[[/ b] [/ b] [/ bin/sh -c/usr/lib/jvm/java-7-oracle/jre/bin/java -Xmx512m -classpath [CLASSPATH] com.google.gwt.i18n.tools。 I18NSync -out/home/alex/development/camomile-cms/svn/application/target/generated-sources/gwt -createMessages com.comomile.cms.ria.fs.client.Messages ]]失败,状态1 at org .apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)(org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache。 maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal。 LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli .MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141 ) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法) 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java的。 lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher。启动(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 引起:org.codehaus.mojo.gwt.shell.ForkedProcessExecutionException:命令[/ i]/bin/sh -c/usr/lib/jvm/java-7-oracle/jre/bin/java -Xmx512m -classpath [CLASSPATH] com.google.gwt.i18n.tools.I18NSync -out/home/alex/development/comomile/svn/application/target/generated-sources/gwt -createMessages com.comomile.cms.ria.fs.client.Messages ]]失败,状态1 at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo $ JavaCommand.execute(AbstractGwtShellMojo.java: 485) 在org.codehaus.mojo.gwt.shell.I18NMojo.doExecute(I18NMojo.java:133) 在org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:172) 在有机apache.maven.plugin.DefaultBuildPluginM anager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ...19多 [错误] [错误] [错误]有关错误和可能的解决方案的更多信息,请阅读以下条款: [错误] [说明1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [错误] [错误]修正后的问题,你可以使用命令 [错误]恢复构建MVN -rf:应用 亚历克斯@亚历克斯-PC:〜/开发/ comomile/SVN

$
+2

你说“...抛出错误......”。如何在你的问题中包含这些错误,以便人们可以帮助你? –

+0

好吧,我会附加他们,但他们没有意义,因为我写在这里... –

+0

他们可能不会对你有意义,但他们希望对别人有意义,因此能够帮助你。 –

回答

0

我找到了解决办法调试后。

解决办法是创建属性文件使用大写首字母消息:例如,而不是“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?"); 
} 

in com.google.gwt.i18n.tools.I18NSync:326。

+0

我为此创建了http://code.google.com/p/google-web-toolkit/issues/detail?id=8315 –