我正在尝试将我的GWT应用转换为使用maven构建。我的第一个问题是编译器似乎不喜欢我的PlaceHistoryMapper中的“@WithTokenizers” - 至少我认为是失败的,如果我评论那些应用程序将编译。我是否需要在我的pom中添加一些额外的配置才能使其正常工作?它在eclipse中编译得很好,或者如果我在eclipse已经编译了GWT源之后尝试maven构建。
以下是我得到的例外情况:
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
:2.3.2:compile (default-compile) on project product_ui_administration: Compilation failure
\workspaces\java\product_ui_administration\src\main\java\com\company\product\ui\administration\AdminPlaceHistoryMapper.java:[13,0] illega
l start of expression
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at 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:319)
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)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(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)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
\workspaces\java\product_ui_administration\src\main\java\com\company\product\ui\administration\AdminPlaceHistoryMapper.java:[13,0] illega
l start of expression
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
这是我的AdminPlaceHistoryMapper接口
// this annotation not working in mvn for some reason
@WithTokenizers({
UserDetailsPlace.Tokenizer.class,
UserPermissionsPlace.Tokenizer.class,
CompanyDetailsPlace.Tokenizer.class,
})
public interface AdminPlaceHistoryMapper extends PlaceHistoryMapper {
}
答案 0 :(得分:1)
这被证明是Eclipse编译器忽略的一个简单的语法问题,但标记了maven GWT编译器。
From the "gwt-maven-plugin Users" Google Group
这对我来说非常清楚,它甚至可以为您提供行号...
无论如何,你不能合法地在你的结尾有一个逗号字符 令牌列表。这是一个语法错误。你的Eclipse编译器 容忍它,但大多数其他编译器不会。
-Jesse