我是使用谷歌应用引擎的新手。当我尝试在我的本地计算机上托管我的网站时,我似乎无法弄清楚如何解决此错误。
到目前为止,我已按照谷歌页面的确切说明进行操作:https://cloud.google.com/appengine/docs/java/gettingstarted/ui_and_code
我收到如下错误:
[INFO] Retrieving Google App Engine Java SDK from Maven
[INFO] ---------------------------------------------------------------- --------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.420 s
[INFO] Finished at: 2015-02-01T22:37:41+13:00
[INFO] Final Memory: 15M/226M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven- plugin:1.9.17:update (default-cli) on project guestbook: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.17:update failed. NoSuchElementException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.17:update (default-cli) on project guestbook: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.17:update failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
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:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.17:update failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.util.NoSuchElementException
at com.google.common.collect.AbstractIterator.next(AbstractIterator.java:154)
at com.google.common.collect.Iterators.find(Iterators.java:717)
at com.google.common.collect.Iterables.find(Iterables.java:646)
at com.google.appengine.SdkResolver.getSdk(SdkResolver.java:50)
at com.google.appengine.appcfg.AbstractAppCfgMojo.resolveAndSetSdkRoot(AbstractAppCfgMojo.java:374)
at com.google.appengine.appcfg.Update.execute(Update.java:26)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
... 20 more
[ERROR]
[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
Your help would be much appreciated!
答案 0 :(得分:1)
这个答案最初出现在这里:
https://stackoverflow.com/a/26375721/2341218
根据此页面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>