【问题标题】:A required class was missing while executing com.google.appengine:appengine-maven-plugin:1.9.4执行 com.google.appengine:appengine-maven-plugin:1.9.4 时缺少必需的类
【发布时间】:2015-10-20 04:31:27
【问题描述】:

我刚刚开始学习使用 Java 对 Google App Engine 应用程序进行编程,并从 Udacity 课程 ud859-master 下载了一个示例。当我运行 第 2 课 > helloWorldEndpoit 时,我收到了这个错误。

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.808 s
[INFO] Finished at: 2015-07-29T14:08:21+05:00
[INFO] Final Memory: 7M/18M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.4:endpoints_get_discovery_doc (default) on project helloworld: Execution default of goal com.google.appengine:appengine-maven-plugin:1.9.4:endpoints_get_discovery_doc failed: A required class was missing while executing com.google.appengine:appengine-maven-plugin:1.9.4:endpoints_get_discovery_doc: com/google/api/server/spi/config/Api
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.google.appengine:appengine-maven-plugin:1.9.4
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/error/.m2/repository/com/google/appengine/appengine-maven-plugin/1.9.4/appengine-maven-plugin-1.9.4.jar
[ERROR] urls[1] = file:/C:/Users/error/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[2] = file:/C:/Users/error/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
[ERROR] urls[3] = file:/C:/Users/error/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
[ERROR] urls[4] = file:/C:/Users/error/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[5] = file:/C:/Users/error/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M2a/org.eclipse.sisu.inject-0.0.0.M2a.jar
[ERROR] urls[6] = file:/C:/Users/error/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar
[ERROR] urls[7] = file:/C:/Users/error/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.16/plexus-interpolation-1.16.jar
[ERROR] urls[8] = file:/C:/Users/error/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.jar
[ERROR] urls[9] = file:/C:/Users/error/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[10] = file:/C:/Users/error/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[11] = file:/C:/Users/error/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[12] = file:/C:/Users/error/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[13] = file:/C:/Users/error/.m2/repository/com/google/guava/guava/14.0.1/guava-14.0.1.jar
[ERROR] urls[14] = file:/C:/Users/error/.m2/repository/com/google/appengine/appengine-tools-sdk/1.9.4/appengine-tools-sdk-1.9.4.jar
[ERROR] urls[15] = file:/C:/Users/error/.m2/repository/com/google/appengine/appengine-local-endpoints/1.9.4/appengine-local-endpoints-1.9.4.jar
[ERROR] urls[16] = file:/C:/Users/error/.m2/repository/com/google/appengine/appengine-endpoints/1.9.4/appengine-endpoints-1.9.4.jar
[ERROR] urls[17] = file:/C:/Users/error/.m2/repository/com/google/appengine/appengine-api-1.0-sdk/1.9.4/appengine-api-1.0-sdk-1.9.4.jar
[ERROR] urls[18] = file:/C:/Users/error/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
[ERROR] urls[19] = file:/C:/Users/error/.m2/repository/eu/infomas/annotation-detector/3.0.1/annotation-detector-3.0.1.jar
[ERROR] urls[20] = file:/C:/Users/error/.m2/repository/org/slf4j/slf4j-nop/1.7.5/slf4j-nop-1.7.5.jar
[ERROR] urls[21] = file:/C:/Users/error/.m2/repository/org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: com.google.api.server.spi.config.Api
[ERROR] -> [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/PluginContainerException

我想知道如何解决这个问题。

【问题讨论】:

  • 你使用的是什么版本的 Maven?
  • @TimBiegeleisen 使用 maven 版本 3.3.3
  • 虽然文档说什么 > 3.1.0 应该可以工作,但值得用 3.1.0 进行测试,看看是否有关于您正在使用的示例代码或 SDK maven 目标 @987654323 @ 基于此失败。

标签: java maven google-app-engine


【解决方案1】:

这是给未来的人的,我遇到了同样的错误。我遵循了几个步骤 -

  1. 在我的pom.xml中添加了这些代码行

    <pluginRepositories>
      <pluginRepository>
        <id>gae-staging1</id>         
    <url>https://oss.sonatype.org/content/repositories/comgoogleappengine- 
         1293/</url>
    </pluginRepository>
    </pluginRepositories>
    
    <repositories>
    <repository>
        <id>twitter-twttr</id>
        <url>http://maven.twttr.com/</url>
    </repository>
    <repository>
        <id>gae-staging1</id>
        <url>https://oss.sonatype.org/content/repositories/comgoogleappengine-1292/</url>
    </repository>
    </repositories>
    
  2. 从我的C:\Users\User\.m2 目录中删除了内容。

  3. 然后运行这些命令mvn package -Xmvn clean packagemvn appengine:run

希望对你有帮助!!!

【讨论】:

    猜你喜欢
    • 2020-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-09
    • 2023-03-16
    • 2019-02-18
    • 1970-01-01
    • 2021-07-02
    相关资源
    最近更新 更多