有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Maven GAE无法执行目标com。谷歌。appengine:appenginemavenplugin:1.9.12:devserver[…]非接触性异常

Maven遇到了这个问题,我发现没有一个解决方案有效:(

波姆。xml https://github.com/Brkk/text-share/blob/master/pom.xml

网络。xml https://github.com/Brkk/text-share/blob/master/src/main/webapp/WEB-INF/web.xml

Maven正在生成

[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building text-share 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> appengine-maven-plugin:1.9.12:devserver (default-cli) @ text-share >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ text-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/paulotabarro/Desktop/workspace/text-share/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ text-share ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ text-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/paulotabarro/Desktop/workspace/text-share/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ text-share ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ text-share ---
[INFO] 
[INFO] --- maven-war-plugin:2.4:war (default-war) @ text-share ---
[INFO] Packaging webapp
[INFO] Assembling webapp [text-share] in [/Users/paulotabarro/Desktop/workspace/text-share/target/text-share-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp webResources [/Users/paulotabarro/Desktop/workspace/text-share/src/main/webapp/WEB-INF] to [/Users/paulotabarro/Desktop/workspace/text-share/target/text-share-1.0-SNAPSHOT]
[INFO] Copying webapp resources [/Users/paulotabarro/Desktop/workspace/text-share/src/main/webapp]
[INFO] Webapp assembled in [101 msecs]
[INFO] Building war: /Users/paulotabarro/Desktop/workspace/text-share/target/text-share-1.0-SNAPSHOT.war
[INFO] 
[INFO] <<< appengine-maven-plugin:1.9.12:devserver (default-cli) @ text-share <<<
[INFO] 
[INFO] --- appengine-maven-plugin:1.9.12:devserver (default-cli) @ text-share ---
[INFO] 
[INFO] Google App Engine Java SDK - Running Development Server
[INFO] 
[INFO] Retrieving Google App Engine Java SDK from Maven
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.692 s
[INFO] Finished at: 2014-10-14T19:12:13-08:00
[INFO] Final Memory: 16M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.12:devserver (default-cli) on project text-share: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.12:devserver failed. NoSuchElementException -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

共 (1) 个答案

  1. # 1 楼答案

    根据这个页面https://code.google.com/p/appengine-maven-plugin/issues/detail?id=41,您不仅需要在<build><pluginManagement>部分添加插件,还需要在<build><plugins>部分添加插件。因此,您需要按如下方式扩展pom:

    <build>
        <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
        <pluginManagement>
            <!  other plugins here  >
            <plugin>
                <groupId>com.google.appengine</groupId>
                <artifactId>appengine-maven-plugin</artifactId>
                <version>1.9.12</version>
                <configuration>
                    <enableJarClasses>false</enableJarClasses>
                </configuration>
            </plugin>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.google.appengine</groupId>
                <artifactId>appengine-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>