Bad request when updating Appengine with mvn appengine:update

天涯浪子 提交于 2019-12-03 03:23:46

I had the same issue as you described. When I added the "version" element in the configuration element, with value pointing to the version of the app in my appengine-web.xml file, mvn appengine:update completed successfully. (maven v3.1.0, appengine plugin v1.8.3)

in pom.xml:

....
<plugin>
   <groupId>com.google.appengine</groupId>
   <artifactId>appengine-maven-plugin</artifactId>
   <version>${appengine.version}</version>
   <configuration>
      <version>MY-VERSION</version>
   </configuration>
</plugin>
...

in appengine-web.xml:

...
<version>MY-VERSION</version>
...

If you generated the project with the archetype skeleton, like I did, and you have a block similar to

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

in your pom.xml and your appengine-web.xml looked like

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

when it got made, then, modify appengine-web.xml to be ${app.version} because they so helpfully already added that property with the archetype but never used it anywhere. Then, update your pom.xml's app.version to be your appropriate version (if you don't use "1"). Then, scroll down in the pom.xml to where you see

            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>${appengine.version}</version>
            <configuration>
                <enableJarClasses>false</enableJarClasses>

and inside the configuration block there add

                <version>${app.version}</version>

Try to change appengine-web.xml entry from <version>0-0-1</version> to <version>1</version>. Regards, Adam.

In changed only the pom.xml file by adding the plugin>configuration>version tag (per below)...

<plugin>
    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-maven-plugin</artifactId>
    <version>${project.appengine.version}</version>
    <configuration>
      <port>8888</port>
     *<version>${app.version}</version>*
    </configuration>
</plugin>

The way I solved this issue was trivial in my console I executed mvn clean install and then the appcfg.cmd -A [your app] update target\appengine-try-java-1.0 command.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!