【问题标题】:Google app engine maven archetype HelloWorld endpoint projectGoogle 应用引擎 Maven 原型 HelloWorld 端点项目
【发布时间】:2020-02-04 09:28:43
【问题描述】:

我正在尝试使用安装了谷歌云插件的 Eclipse 在本地构建和运行该项目,但该项目显示错误。

我已将项目上传到 Github。你可以在这里找到它。

Github maven based google app engine endpoints project

没有任何修改只是一个来自 maven 存储库的普通项目。

这是错误的屏幕截图。

【问题讨论】:

  • 您是否尝试忽略 pom.xml 文件中的 <goal> 标记?在很多这样的情况下,这似乎是解决方案。让我知道这是否有帮助。更多信息可以找到here
  • 我已经把整个项目上传到了 Github,请在那里查看。上面给出了链接
  • 我检查了你的 pom.xml 文件,我注意到这些行:<goals> <goal>display-dependency-updates</goal> <goal>display-plugin-updates</goal> </goals> 根据this documentation,这个标签只显示所有有新版本可用的依赖项。由于这对于在 Eclipse 中部署项目并不重要,因此我建议您添加 <ignore> 标记以静默忽略插件执行。
  • 我不知道如何使用 案例,但我在删除目标后尝试过,它在构建中显示:[错误] 在插件 com.google 中找不到目标'devserver' .cloud.tools:appengine-maven-plugin:1.3.1 在可用目标中 deploy, deployCron, deployDispatch, deployDos, deployIndex, deployQueue, genRepoInfoFile, help, run, stage, start, stop -> [Help 1] [ERROR] [ ERROR] 要查看错误的完整堆栈跟踪,请使用 -e 开关重新运行 Maven。 [错误] 使用 -X 开关重新运行 Maven 以启用完整的调试日志记录。
  • 为了使用忽略标签,您必须在我的第一条评论中关注documentation。请尝试一下,让我知道它是否对您有用。谢谢。

标签: java eclipse maven google-app-engine google-cloud-endpoints


【解决方案1】:

根据MojoHaus documentation

"versions:display-dependency-updates 扫描项目的依赖关系并 生成具有较新版本的依赖项的报告 可用。”

"versions:display-plugin-updates 扫描项目的插件和 生成具有较新版本的插件的报告 可用,照顾 Maven 版本的先决条件。”

为了解决此问题,请尝试在您的 pom.xml 文件中进行以下更改:

  1. 更新版本到 2.2.1:

    <dependency>
        <groupId>com.google.endpoints</groupId>
        <artifactId>endpoints-framework</artifactId>
        <!-- Update version -->
        <version>2.0.7</version>                         
    </dependency>
    
  2. 将版本更新到 v 1.0.2 并添加您的 projectID:

    <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>endpoints-framework-maven-plugin</artifactId>
        <!-- Update version -->
        <version>1.0.0</version>
        <configuration>
            <!-- add project id here -->
            <hostname>YOUR-PROJECT-ID.appspot.com</hostname>             
        </configuration>
    </plugin>
    
  3. 将 App Engine Maven 插件更新到最新版本。

请记住,根据Google Documentation

带有 com.google.appengine 组的旧 App Engine Maven 插件与 Endpoints Frameworks 插件不兼容。您必须使用新版本。

你会找到最新版本here

        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <!-- Update version here -->
            <version>1.3.1</version>
            <configuration>
                <!-- deploy configuration -->
            </configuration>
        </plugin>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 2011-03-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多