Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad request when updating Appengine with mvn appengine:update

i'm getting the following error, when I try to update a appengine-application with the appengine-maven-plugin:

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]$)$'

This is confusing to my because my appengine-web.xml looks like follows:

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

I'm wondering why appengine-maven-plugin wants to use 1.8.3 as application-version. 1.8.3 is the version of appengine-sdk i want to use. In my POM it's configured as follows:

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

and later on

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

${appengine.app.version} points to 1.8.3 I'm using Maven in Version 3.1 and Java 1.7.0_25

What do I wrong? Can anyone help my? Thanks a lot

like image 404
Ansgar Schulte Avatar asked Aug 14 '13 18:08

Ansgar Schulte


People also ask

How to force Maven to update all corrupted snapshot dependencies?

Therefore, to force Maven to update all corrupted SNAPSHOT dependencies, we should add in our command the -U/–update-snapshots option: Still, we have to remember that the option does not re-download a SNAPSHOT dependency if Maven already downloaded it and if the checksum is the same.

How to resolve Maven dependencies without any package or install?

We can tell Maven to resolve our dependencies and update snapshots without any package or install command. For this purpose, we'll use the dependency:resolve goal, by including the-U option:

Should I run repository updates in debug mode?

Additionally, we should run any repository update in debug mode, adding the -X option after -U to have a better picture of what happens during the update. 6.1.

What is corrupted dependencies in Maven?

Corrupted Dependencies While downloading the dependencies, a network glitch can happen, resulting in corrupted dependencies. The interrupted dependency download is the leading cause of corruption. Maven will display a message accordingly: Could not resolve dependencies for project ... Let's see next how we can solve this issue. 6.


2 Answers

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

like image 88
jhp Avatar answered Nov 09 '22 12:11

jhp


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>
like image 44
iruC Avatar answered Nov 09 '22 12:11

iruC