-1

I am trying to do as it's written here:

https://spring.io/guides/gs/spring-boot-for-azure/

But everytime i deploy, i get this error:

Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:0.1.5:deploy (default-cli) on project gs-spring-boot: Execution default-cli of goal com.microsoft.azure:azure-webapp-maven-plugin:0.1.5:deploy failed: A required class was missing while executing com.microsoft.azure:azure-webapp-maven-plugin:0.1.5:deploy: javax/xml/bind/JAXBException

I tried all these things:

How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

And still doesn't work.

Cœur
  • 34,719
  • 24
  • 185
  • 251
YourDoom
  • 45
  • 8

3 Answers3

0

I followed the tutorial and deployed the sample spring-boot app to azure successfully. Please refer to my working steps.

1.create the spring boot app from the site.

2.create the service principal and configure the setting.xml in maven.(Just follow the above tutoral)

3.Add below plugin configuration in your pom.xml then run the command: mvnw azure-webapp:deploy.

<plugin>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-webapp-maven-plugin</artifactId>

    <configuration>

        <!-- Web App information -->
        <resourceGroup><your rg name></resourceGroup>
        <appName><app name></appName>
        <appServicePlanName><your service plan></appServicePlanName>

        <!-- Java Runtime Stack for Web App on Linux-->
        <!--<linuxRuntime>tomcat 8.5-jre8</linuxRuntime>-->
        <javaVersion>1.8</javaVersion>
        <javaWebContainer>tomcat 8.5</javaWebContainer>
    </configuration>
</plugin>

4.Navigate to the site:https://.azurewebsites.net/greeting

enter image description here

Jay Gong
  • 22,028
  • 2
  • 18
  • 27
0

pom.xml:

<plugin>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-webapp-maven-plugin</artifactId>
            <version>0.1.5</version>
            <configuration>
                <authentication>
                    <serverId>azure-auth</serverId>
                </authentication>
                <resourceGroup>maven-plugin</resourceGroup>
                <appName>maven-web-app-${maven.build.timestamp}</appName>
                <region>westus</region>
                <javaVersion>11</javaVersion>
                <deploymentType>ftp</deploymentType>
                <stopAppDuringDeployment>true</stopAppDuringDeployment>
                <resources>
                    <resource>
                        <directory>${project.basedir}/target</directory>
                        <targetPath>/</targetPath>
                        <includes>
                            <include>*.jar</include>
                        </includes>
                    </resource>
                    <resource>
                        <directory>${project.basedir}</directory>
                        <targetPath>/</targetPath>
                        <includes>
                            <include>web.config</include>
                        </includes>
                    </resource>
                </resources>
            </configuration>
        </plugin>
YourDoom
  • 45
  • 8
-1

I got the same error message and I resolved the issue, please ensure that you are using Java 8 for your JAVA_HOME

For my case, the root cause of this that azure-webapp-maven-plugin is using java 1.8 but it cannot find it since I uninstalled it. I installed java 11.

Check out the below link: https://github.com/Microsoft/azure-maven-plugins/issues/162

Hope it helps.

xi Ouyang
  • 1
  • 2