azure-maven-plugins: The parameter javaVersion has an invalid value

Plugin name and version

azure-webapp-maven-plugin 1.5.4

Plugin configuration in your pom.xml

<plugins>
    <plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-webapp-maven-plugin</artifactId>
        <version>1.5.4</version>
        <configuration>
            <schemaVersion>v2</schemaVersion>
            <resourceGroup>${RESOURCEGROUP_NAME}</resourceGroup>
            <appName>${WEBAPP_NAME}</appName>
            <runtime>
                <os>linux</os>
                <javaVersion>jre8</javaVersion>
                <webContainer>tomcat 8.5</webContainer>
            </runtime>
            <deployment>
                <resources>
                    <resource>
                        <directory>${project.basedir}/target</directory>
                        <includes>
                            <include>*.war</include>
                        </includes>
                    </resource>
                </resources>
            </deployment>
        </configuration>
    </plugin

Expected behavior

The application is deployed. this configuration worked for several months and recently, I still get this error message.

Actual behavior

Error message : [ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.5.4:deploy (default-cli) on project ui5.labdfg: Status code 400, {"Code":"BadRequest","Message":"The parameter javaVersion has an invalid value.","Target":null,"Details":[{"Message":"The parameter javaVersion has an invalid value."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"01007","MessageTemplate":"The parameter {0} has an invalid value.","Parameters":["javaVersion"],"Code":"BadRequest","Message":"The parameter javaVersion has an invalid value."}}],"Innererror":null} -> [Help 1]

By removong javaVersion I obtain this error

[ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.5.4:deploy (default-cli) on project ui5.labdfg: Unknown value of <javaVersion>. Supported values is jre8 -> [Help 1]

The server is an Web App on Linux with Tomcat 8.5

Steps to reproduce the problem

Same Plugin configuration

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 28 (4 by maintainers)

Most upvoted comments

@ubamrein @tim-slaton-bib @request92 @marceloverdijk @sshaw8 @joemat @kunleawotunbo @ernesto-arm Thank you all, our service team has rolled out a fix and this issue should be fixed.

Mitigation Instructions

Hi everyone, our engineering team is aware of the problem and we are actively working on a fix. To mitigate the problem, please deploy your JAR or WAR using ZIP-deploy or WAR-deploy respectively (documentation here).

We do not advise deploying JARs or WARs via FTP.

@kunleawotunbo @request92

@request92 @kunleawotunbo @ernesto-arm Thanks for your report, my team is working with app service team to investigate this issue, will update here once we get any progress.

Please is there an alternative way to deploy my application pending the time the issue is being resolved. I need to deploy my update to the server.

@request92 @kunleawotunbo @ernesto-arm Thanks for your report, my team is working with app service team to investigate this issue, will update here once we get any progress.

Note when reverting back to the “old” configuration I can deploy successfully.

In that case I also see that <jarFile>build/libs/my-backend-2.0.jar</jarFile> is copied to /target/azure-webapp/my-backend/app.jar.

So this seems to behave differently.

@Flanker32 @marceloverdijk @request92

Yeah that’s what I meant. In scheme version v2 the copying command does not rename the file. I think the whole V1 to V2 Scheme conversion is broken, and since I couldn’t find any commit fixing this bug in this repo, I am not sure if this issue should be closed, or at least a new one should be opened, facing the conversion stuff from V1 to V2.

Though there has been a fix in the repo for the docker, which is loaded for the Java WebApp environment. That might explain why some stuff works. It now copies the app to default.jar if there is no app.jar found, which I guess in the case of @marceloverdijk leads to running an old version of the app.

But still, if you use a configuration, as it is mentioned in the documentation, there still problems. It is especially frustrating, since V1 is marked as deprecated…

I am having the same error. I was about to open an issue here. I have a running app on Azure, I updated my code without changing any configuration using mvn azure-webapp:deploy But I got the above error.