eclipse - 无法执行 objective-c om.google.appengine :appengine-maven-plugin:1. 9.67:devserver

标签 eclipse maven google-app-engine google-cloud-platform

嘿,我在 devserver 和更新调用上启动我的 maven 项目时遇到问题。 我将我的 Maven 项目构建为与谷歌云引擎一起运行,但我遇到了这个问题并且无法启动我的服务器。 这是我的 pom.xml:

<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>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>

  <groupId>trainingBuddyServer</groupId>
  <artifactId>Training-Buddy-Server</artifactId>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
    <archiveClasses>true</archiveClasses>
  </properties>

  <prerequisites>
    <maven>3.5</maven>
  </prerequisites>

  <dependencies>
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-api-1.0-sdk</artifactId>
      <version>1.9.67</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <type>jar</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>22.0</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.objectify</groupId>
      <artifactId>objectify</artifactId>
      <version>5.1.17</version>
    </dependency>

    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-api-1.0-sdk</artifactId>
      <version>1.9.67</version>
    </dependency>

    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-endpoints</artifactId>
      <version>1.9.67</version>
    </dependency>
    <dependency>
      <groupId>com.google.endpoints</groupId>
      <artifactId>endpoints-framework</artifactId>
      <version>2.0.7</version>
    </dependency>
    <dependency>
      <groupId>com.google.endpoints</groupId>
      <artifactId>endpoints-management-control-appengine</artifactId>
      <version>1.0.3</version>
    </dependency>
    <dependency>
      <groupId>com.google.endpoints</groupId>
      <artifactId>endpoints-framework-auth</artifactId>
      <version>1.0.3</version>
    </dependency>

    <!-- Test Dependencies -->
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-testing</artifactId>
      <version>1.9.67</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-api-stubs</artifactId>
      <version>1.9.67</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-tools-sdk</artifactId>
      <version>1.9.67</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>0.33</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.10.19</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <!-- for hot reload of the web application-->
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
    <plugins>
      <plugin>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>1.9.67</version>
        <configuration>
          <appId>trainingbuddy-221215</appId> <!-- Override appengine-web.xml <project> -->
          <version>1</version>
          <fullScanSeconds>1</fullScanSeconds>
          <retainUploadDir>true</retainUploadDir>
        </configuration>
      </plugin>

      <plugin>
           <groupId>com.google.cloud.tools</groupId>
           <artifactId>appengine-maven-plugin</artifactId>
           <version>1.3.1</version>
           <configuration>
              <deploy.promote>true</deploy.promote>
              <deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
            </configuration>
        </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.5</version>
                </requireMavenVersion>
                <requirePluginVersions>
                   <message>Best Practice is to always define plugin versions!</message>
                   <banLatest>true</banLatest>
                   <banRelease>true</banRelease>
                   <phases>clean,deploy,verify,appengine:run,appengine:deploy,appengine:update,appengine:devappaserver,site</phases>
                </requirePluginVersions>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

我认为 pom 文件有问题,因为错误表明它找不到这个元素“com.google.appengine:appengine-maven-plugin:1.9.67:devserver”。因此,如果有帮助,这就是错误:

[INFO] --- appengine-maven-plugin:1.9.67:devserver (default-cli) @ Training-Buddy-Server ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.212 s
[INFO] Finished at: 2018-11-01T23:37:27+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver (default-cli) on project Training-Buddy-Server: The parameters 'project' for goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver are missing or invalid -> [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/PluginParameterException

也许有人知道如何解决这个问题?

最佳答案

添加

    <project>YOUR PROJECT ID</project>

确实也为我解决了这个问题,但是我没有使用较新的 gclod maven 插件,而是使用较旧的 appengine 插件:

    <groupId>com.google.cloud.tools</groupId>
    <artifactId>appengine-maven-plugin</artifactId>

对比我的

    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-maven-plugin</artifactId>

在某些时候我可能应该继续使用 gcloud 插件,但现在我没有时间。

旧的 appengine 插件也适用于(未记录的)“project”配置标签。谷歌确实令人困惑,而且工作也很糟糕,因为他们从 1.9.67 及更高版本开始 ( started examples ) 不起作用。此外,如果从现在开始需要它,我们应该已经获得了一些相关信息。

作为记录,我发布了我的多模块/服务父 pom 片段,包括带有旧应用引擎插件的插件管理:

    <pluginManagement>
      <plugins>
          <plugin>
              <groupId>com.google.appengine</groupId>
              <artifactId>appengine-maven-plugin</artifactId>
              <version>${appengine.target.version}</version>
              <configuration>
                  <project>YOUR PROJECT ID</project> <!-- WHAT DO WE NEED THIS FOR-->
                  <jvmFlags>
                      <jvmFlag>-Ddatastore.backing_store=${project.basedir}/local_db.bin</jvmFlag>
                  </jvmFlags>
                  <fullScanSeconds>-1</fullScanSeconds>
              </configuration>
          </plugin>
      </plugins>
  </pluginManagement>

关于eclipse - 无法执行 objective-c om.google.appengine :appengine-maven-plugin:1. 9.67:devserver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53109943/

相关文章:

python - 这个重定向有什么问题? (谷歌应用引擎 - Python)

java - JDO在Date中不存储时间信息,只存储日期

java - 在jsp中显示印地语字体

java - 当没有通过 -P 指定配置文件时,执行什么 Maven 配置文件?

google-app-engine - 追踪 Google App Engine Golang 应用程序中的内存泄漏?

java - karaf 容器中的 OSGI 集成测试

java - 从命令行运行 Verticle 时找不到包

java - 从 EAR 项目中的 War 项目访问 EJB 项目中的类?

eclipse - Mylyn Task Focus用户界面

java - 将 AWS 项目从 git 导入到本地计算机