无法执行目标(GWT Maven插件)

时间:2015-09-23 20:06:57

标签: java maven gwt

我有一个以GWT为框架的Maven Web应用程序项目(Windows 7,Netbeans 8,JDK 8)。我是初学者,所以我按照tutorialspoint的教程进行操作。我只有一个标签,编译好了。现在,I've added a button,我没有明显的理由得到了这个模糊的错误。

Main.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
    <!-- Inherit the core Web Toolkit stuff.                        -->
    <inherits name='com.google.gwt.user.User' />

        <!-- Inherit the default GWT style sheet.  You can change       -->
    <!-- the theme of your GWT application by uncommenting          -->
    <!-- any one of the following lines.                            -->
    <inherits name='com.google.gwt.user.theme.standard.Standard' />
    <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
    <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

        <!-- Other module inherits                                      -->

    <!-- Specify the app entry point class.                         -->

        <entry-point class="org.manager.client.OrderManager"/>
        <source path="client"/>

</module>

manager.html (我运行Tomcat时访问的页面):

<!doctype html>
<!--
The DOCTYPE declaration above will set the browser's rendering engine into
"Standards Mode". Replacing this declaration with a "Quirks Mode" doctype may
lead to some differences in layout.
-->
<html>
    <head>
        <meta name='gwt:module' content='org.manager.Main=org.manager.Main'>
        <title>Gerenciador</title>
        <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
        <script type="text/javascript" src="org.manager.Main/org.manager.Main.nocache.js"></script>
    </head>
    <body>
        <h1>Label Widget Demonstration</h1>
        <div id="gwtContainer"></div>
    </body>
</html>

OrderManager.java (入口点)

package org.manager.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class OrderManager implements EntryPoint {

    @Override
    public void onModuleLoad() {

        Label label = new Label("Fuck, this shit is fucking awesome!");
        label.setTitle("Yeah!");
        label.setStyleName("gwt-Green-Border");
        Button redButton = new Button("Red");
        redButton.setWidth("100px");
        redButton.addClickHandler((ClickEvent event) -> {
            Window.alert("Red Button clicked!");
        });

        VerticalPanel panel = new VerticalPanel();
        panel.setSpacing(10);
        panel.add(label);
        panel.add(redButton);

        RootPanel.get("gwtContainer").add(panel);

    }

}

错误是:

G:\Insanity\Java\jdk1.8.0_51\jre\bin\java -Xmx512m -classpath "G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\java";"G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\resources";"G:\Insanity\Java\Workspace\Volapp\Volapp\target\classes";"C:\Users\EricsonWRP\.m2\repository\com\jwillians\JWeb\1.0\JWeb-1.0.jar";"C:\Users\EricsonWRP\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar";"C:\Users\EricsonWRP\.m2\repository\org\javatuples\javatuples\1.2\javatuples-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\javax\mail\mail\1.4\mail-1.4.jar";"C:\Users\EricsonWRP\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-user\2.0.1\gwt-user-2.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\javaee-web-api\7.0\javaee-web-api-7.0.jar";"C:\Users\EricsonWRP\.m2\repository\org\jsoup\jsoup\1.8.3\jsoup-1.8.3.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\jersey\core\jersey-common\2.4.1\jersey-common-2.4.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\guava\guava\14.0.1\guava-14.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-api\2.2.0-b21\hk2-api-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-utils\2.2.0-b21\hk2-utils-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\javax.inject\2.2.0-b21\javax.inject-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-locator\2.2.0-b21\hk2-locator-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\asm-all-repackaged\2.2.0-b21\asm-all-repackaged-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\cglib\2.2.0-b21\cglib-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\osgi-resource-locator\1.0.1\osgi-resource-locator-1.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\ws\rs\javax.ws.rs-api\2.0\javax.ws.rs-api-2.0.jar";"C:\Users\EricsonWRP\.m2\repository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-dev\2.0.1\gwt-dev-2.0.1.jar" com.google.gwt.dev.Compiler -gen "G:\Insanity\Java\Workspace\Volapp\Volapp\target\.generated" -logLevel INFO -style OBF -war "G:\Insanity\Java\Workspace\Volapp\Volapp\target\Volapp-1.0" -localWorkers 4 -soyc -extra "G:\Insanity\Java\Workspace\Volapp\Volapp\target\extra" org.manager.Main
Compiling module org.manager.Main
   Validating newly compiled units
      [ERROR] Errors in 'file:/G:/Insanity/Java/Workspace/Volapp/Volapp/src/main/java/org/manager/client/OrderManager.java'
         [ERROR] Line 21: ClickEvent cannot be resolved
         [ERROR] Line 21: Syntax error on token "event", delete this token
         [ERROR] Line 21: Syntax error on tokens, delete these tokens
         [ERROR] Line 22: Window.alert cannot be resolved
         [ERROR] Line 22: Syntax error on token(s), misplaced construct(s)
         [ERROR] Line 23: Syntax error on tokens, delete these tokens
   Finding entry point classes
      [ERROR] Unable to find type 'org.manager.client.OrderManager'
         [ERROR] Hint: Previous compiler errors may have made this type unavailable
         [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 17.206s
Finished at: Wed Sep 23 13:55:25 BRT 2015
Final Memory: 18M/162M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:1.2:compile (default) on project Volapp: Command [[
G:\Insanity\Java\jdk1.8.0_51\jre\bin\java -Xmx512m -classpath "G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\java";"G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\resources";"G:\Insanity\Java\Workspace\Volapp\Volapp\target\classes";"C:\Users\EricsonWRP\.m2\repository\com\jwillians\JWeb\1.0\JWeb-1.0.jar";"C:\Users\EricsonWRP\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar";"C:\Users\EricsonWRP\.m2\repository\org\javatuples\javatuples\1.2\javatuples-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\javax\mail\mail\1.4\mail-1.4.jar";"C:\Users\EricsonWRP\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-user\2.0.1\gwt-user-2.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\javaee-web-api\7.0\javaee-web-api-7.0.jar";"C:\Users\EricsonWRP\.m2\repository\org\jsoup\jsoup\1.8.3\jsoup-1.8.3.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\jersey\core\jersey-common\2.4.1\jersey-common-2.4.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\guava\guava\14.0.1\guava-14.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-api\2.2.0-b21\hk2-api-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-utils\2.2.0-b21\hk2-utils-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\javax.inject\2.2.0-b21\javax.inject-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-locator\2.2.0-b21\hk2-locator-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\asm-all-repackaged\2.2.0-b21\asm-all-repackaged-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\cglib\2.2.0-b21\cglib-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\osgi-resource-locator\1.0.1\osgi-resource-locator-1.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\ws\rs\javax.ws.rs-api\2.0\javax.ws.rs-api-2.0.jar";"C:\Users\EricsonWRP\.m2\repository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-dev\2.0.1\gwt-dev-2.0.1.jar" com.google.gwt.dev.Compiler -gen "G:\Insanity\Java\Workspace\Volapp\Volapp\target\.generated" -logLevel INFO -style OBF -war "G:\Insanity\Java\Workspace\Volapp\Volapp\target\Volapp-1.0" -localWorkers 4 -soyc -extra "G:\Insanity\Java\Workspace\Volapp\Volapp\target\extra" org.manager.Main
]] failed with status 1
-> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:1.2:compile (default) on project Volapp: Command [[
G:\Insanity\Java\jdk1.8.0_51\jre\bin\java -Xmx512m -classpath "G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\java";"G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\resources";"G:\Insanity\Java\Workspace\Volapp\Volapp\target\classes";"C:\Users\EricsonWRP\.m2\repository\com\jwillians\JWeb\1.0\JWeb-1.0.jar";"C:\Users\EricsonWRP\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar";"C:\Users\EricsonWRP\.m2\repository\org\javatuples\javatuples\1.2\javatuples-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\javax\mail\mail\1.4\mail-1.4.jar";"C:\Users\EricsonWRP\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-user\2.0.1\gwt-user-2.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\javaee-web-api\7.0\javaee-web-api-7.0.jar";"C:\Users\EricsonWRP\.m2\repository\org\jsoup\jsoup\1.8.3\jsoup-1.8.3.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\jersey\core\jersey-common\2.4.1\jersey-common-2.4.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\guava\guava\14.0.1\guava-14.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-api\2.2.0-b21\hk2-api-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-utils\2.2.0-b21\hk2-utils-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\javax.inject\2.2.0-b21\javax.inject-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-locator\2.2.0-b21\hk2-locator-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\asm-all-repackaged\2.2.0-b21\asm-all-repackaged-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\cglib\2.2.0-b21\cglib-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\osgi-resource-locator\1.0.1\osgi-resource-locator-1.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\ws\rs\javax.ws.rs-api\2.0\javax.ws.rs-api-2.0.jar";"C:\Users\EricsonWRP\.m2\repository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-dev\2.0.1\gwt-dev-2.0.1.jar" com.google.gwt.dev.Compiler -gen "G:\Insanity\Java\Workspace\Volapp\Volapp\target\.generated" -logLevel INFO -style OBF -war "G:\Insanity\Java\Workspace\Volapp\Volapp\target\Volapp-1.0" -localWorkers 4 -soyc -extra "G:\Insanity\Java\Workspace\Volapp\Volapp\target\extra" org.manager.Main
]] failed with status 1
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    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: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)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    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.codehaus.mojo.gwt.shell.ForkedProcessExecutionException: Command [[
G:\Insanity\Java\jdk1.8.0_51\jre\bin\java -Xmx512m -classpath "G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\java";"G:\Insanity\Java\Workspace\Volapp\Volapp\src\main\resources";"G:\Insanity\Java\Workspace\Volapp\Volapp\target\classes";"C:\Users\EricsonWRP\.m2\repository\com\jwillians\JWeb\1.0\JWeb-1.0.jar";"C:\Users\EricsonWRP\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar";"C:\Users\EricsonWRP\.m2\repository\org\javatuples\javatuples\1.2\javatuples-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\javax\mail\mail\1.4\mail-1.4.jar";"C:\Users\EricsonWRP\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-user\2.0.1\gwt-user-2.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\javaee-web-api\7.0\javaee-web-api-7.0.jar";"C:\Users\EricsonWRP\.m2\repository\org\jsoup\jsoup\1.8.3\jsoup-1.8.3.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\jersey\core\jersey-common\2.4.1\jersey-common-2.4.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\guava\guava\14.0.1\guava-14.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-api\2.2.0-b21\hk2-api-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-utils\2.2.0-b21\hk2-utils-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\javax.inject\2.2.0-b21\javax.inject-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\hk2-locator\2.2.0-b21\hk2-locator-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\asm-all-repackaged\2.2.0-b21\asm-all-repackaged-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\external\cglib\2.2.0-b21\cglib-2.2.0-b21.jar";"C:\Users\EricsonWRP\.m2\repository\org\glassfish\hk2\osgi-resource-locator\1.0.1\osgi-resource-locator-1.0.1.jar";"C:\Users\EricsonWRP\.m2\repository\javax\ws\rs\javax.ws.rs-api\2.0\javax.ws.rs-api-2.0.jar";"C:\Users\EricsonWRP\.m2\repository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar";"C:\Users\EricsonWRP\.m2\repository\com\google\gwt\gwt-dev\2.0.1\gwt-dev-2.0.1.jar" com.google.gwt.dev.Compiler -gen "G:\Insanity\Java\Workspace\Volapp\Volapp\target\.generated" -logLevel INFO -style OBF -war "G:\Insanity\Java\Workspace\Volapp\Volapp\target\Volapp-1.0" -localWorkers 4 -soyc -extra "G:\Insanity\Java\Workspace\Volapp\Volapp\target\extra" org.manager.Main
]] failed with status 1
    at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo$JavaCommand.execute(AbstractGwtShellMojo.java:409)
    at org.codehaus.mojo.gwt.shell.CompileMojo.compile(CompileMojo.java:232)
    at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute(CompileMojo.java:159)
    at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:119)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more


For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

这是我的 pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.jwillians</groupId>
    <artifactId>Volapp</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>
    <name>Volapp</name>
    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <netbeans.hint.deploy.server>Tomcat7</netbeans.hint.deploy.server>
        <gwt.version>2.0.3</gwt.version>
        <runTarget>welcomeGWT.html</runTarget>
    </properties>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>JWeb</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>2.0.1</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.8.3</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <version>2.4.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>fully.qualified.MainClass</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.3-SNAPSHOT</version>
                <configuration>
                    <url>http://localhost:8080/manager/text</url>
                    <username>root</username>
                    <password>cthulhu7</password>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>remove-javax</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <tasks>
                        <delete dir="${project.build.directory}/classes/javax"/>
                    </tasks>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

对于&#34;问题&#34;的范围感到抱歉。这些&#34; java + maven +框架&#34;东西变得很乱。

1 个答案:

答案 0 :(得分:2)

GWT还不支持lambda(一般来说就是Java 8语法),并且在版本2.0.1中肯定不支持它们。您必须将ClickHandler重写为匿名类,以使其与Java 7语法兼容。

仅供参考,2.8.0-SNAPSHOT支持Java 8(作为源语言)(2.8.0应在今年晚些时候发布)