无法执行目标com.google.appengine:appengine-maven-plugin:1.9.67:devserver

时间:2018-11-01 21:57:22

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

嘿,我在devserver上启动我的maven项目并更新调用时遇到问题。 我将我的Maven项目与Google云引擎一起运行,但是我遇到了这个问题,无法启动服务器。 这是我的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

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

4 个答案:

答案 0 :(得分:3)

添加

    <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插件还可以与(未记录)“项目”配置标记一起使用。从1.9.67及更高版本开始,由于Google的(started examples)无效({{3)}无效,这确实使Google感到困惑,并且工作很差。另外,如果从现在开始需要它,我们应该已经获得了一些信息。

为了记录在案,我要发布多模块/服务的父pom代码段,其中包括旧的appengine插件的插件管理:

    <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>

答案 1 :(得分:1)

您设法解决这个问题了吗?我已经使用我的多模块项目pom至少3年了,没有问题,但是从1.9.67开始,我不再能够通过appengine maven插件部署或运行​​devserver,并且出现相同的错误:

目标com.google.appengine:appengine-maven-plugin:1.9.67:devserver的参数“项目”丢失或无效

使用1.9.65对我有用,因此,作为一个短期解决方案,您应该可以使用该版本,但是我不知道您允许部署多少旧版本。

答案 2 :(得分:1)

我在使用最新的AppEngine时遇到了同样的问题。在低于1.9.64的情况下,它可以正常工作,但在更高版本中会产生相同的错误。今天,我通过将文件pom.xml添加为

来解决了该问题。
Any Measure = SWITCH ( 'All Measures'[Measure Name] , "Sales" , [Sales] ,"COGS", [COGS] , "GP" , [GP] , "GP%" , [GP%] )

答案 3 :(得分:1)

自1.9.66起,这是一个问题:

  

目标的参数“项目”   com.google.appengine:appengine-maven-plugin:1.9.66:...丢失或   无效

相关问题