-1

This is my first time deploying to Azure. I have been trying to deploy my spring-boot app to Azure App service. I have followed all these steps...

  1. az login
  2. az ad sp create-for-rbac --name "app-name" --password "password"
  3. update settings.xml
  4. mvn azure-webapp:config
  5. mvn clean package azure-webapp:deploy

But I am getting the following error..... [ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.8.0:deploy (default-cli) on project AppName: No executable jar found in target folder according to resource filter 'Resource {targetPath: C:\xxxxxx\AppName\target\azure-webapp\xxxx-spring-app-539b496b-9dfc-4201-8ffd-44b828cad6b8, filtering: false, FileSet {directory: C:\xxxxxx\AppName\target, PatternSet [includes: {*.jar}, excludes: {}]}}', please make sure the resource filter is correct and you have built the jar. -> [Help 1]

My jar is created in C:\xxxxxx\AppName\target folder, but deployment to Azure is failing. What am I missing??

Shabs
  • 9
  • 1
  • 4

1 Answers1

0

Posting the solution in case anyone faces the same problem....

The error was due to missing Main-Class entry in the manifest file. Adding this entry to pom.xml resolved the issue.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>app.com.MainClass</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin> 
Shabs
  • 9
  • 1
  • 4