使用mvn appengine更新Appengine时出现错误请求:update

Ans*_*lte 7 google-app-engine maven-plugin

当我尝试使用appengine-maven-plugin更新appengine-application时,我收到以下错误:

400 Bad Request
Error when loading application configuration:
Unable to assign value '1.8.3' to attribute 'version':
Value '1.8.3' for version does not match expression '^(?:^(?!-)[a-z\d\-]{0,62}[a-z\d]$)$'
Run Code Online (Sandbox Code Playgroud)

这让我感到困惑,因为我的appengine-web.xml如下所示:

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>helloworld</application>
    <version>0-0-1</version>
    <threadsafe>true</threadsafe>
    <precompilation-enabled>false</precompilation-enabled>

    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    </system-properties>
</appengine-web-app>
Run Code Online (Sandbox Code Playgroud)

我想知道为什么appengine-maven-plugin想要使用1.8.3作为应用程序版本.1.8.3是我想要使用的appengine-sdk的版本.在我的POM中,它配置如下:

<dependency>
    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-api-1.0-sdk</artifactId>
    <version>${appengine.version}</version>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>jstl</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

后来

<plugin>
    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-maven-plugin</artifactId>
    <version>${appengine.version}</version>
    <configuration>
        <appVersion>${appengine.app.version}</appVersion>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

$ {appengine.app.version}指向1.8.3我在版本3.1和Java 1.7.0_25中使用Maven

我错了什么?任何人都可以帮我吗?非常感谢

jhp*_*jhp 12

我和你描述的问题一样.当我在配置元素中添加"version"元素时,其值指向我的appengine-web.xml文件中的应用程序版本,mvn appengine:update已成功完成.(maven v3.1.0,appengine plugin v1.8.3)

在pom.xml中:

....
<plugin>
   <groupId>com.google.appengine</groupId>
   <artifactId>appengine-maven-plugin</artifactId>
   <version>${appengine.version}</version>
   <configuration>
      <version>MY-VERSION</version>
   </configuration>
</plugin>
...
Run Code Online (Sandbox Code Playgroud)

在appengine-web.xml中:

...
<version>MY-VERSION</version>
...
Run Code Online (Sandbox Code Playgroud)


小智 5

如果您使用原型骨架生成项目,就像我一样,并且您有一个类似的块

<properties>
    <app.id>MY-GAE-PROJECT-ID</app.id>
    <app.version>1</app.version>
    <appengine.version>1.9.20</appengine.version>
    <gcloud.plugin.version>0.9.58.v20150505</gcloud.plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Run Code Online (Sandbox Code Playgroud)

在您的pom.xml中,您的appengine-web.xml看起来像

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>${app.id}</application>
<version>1</version>
etc....
Run Code Online (Sandbox Code Playgroud)

当它被创建时,然后将appengine-web.xml修改为$ {app.version},因为它们已经如此有用地已经使用原型添加了该属性但从未在任何地方使用它.然后,将pom.xml的app.version更新为适当的版本(如果不使用"1").然后,在pom.xml中向下滚动到您看到的位置

            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>${appengine.version}</version>
            <configuration>
                <enableJarClasses>false</enableJarClasses>
Run Code Online (Sandbox Code Playgroud)

并在配置块内添加

                <version>${app.version}</version>
Run Code Online (Sandbox Code Playgroud)