/usr/local/tomcat/webapps/ROOT/WEB-INF folder remains empty from GITHub Actions Java Web App deploy

Basujita Bhattacharya 41 Reputation points Microsoft Employee
2023-01-05T20:36:18.417+00:00

I am Deploying a Simple Java Web App in Azure App Service using GitHub Actions workflow file.
App Service is running on Java11/Tomcat 9.0 stack.

Java Code > https://github.com/BasujitaBhattacharya/JavaWebApp.

The artefacts generated after the mvn clean install has the classes and lib folder generated inside the snapshot war.
However, after the deploy action when my webapp failed to function as expected,
I am connected to the container via ssh and found that WEB-INF folder is empty.

The folder structure should be WEB-INF\classes\com\valeykey\frontend.
The class files must be inside this directory structure.

Any insights will be really helpful, thanks in advance.

Below is my GH Actions workflow file >

name: Build and deploy WAR app to Azure Web App - JavaWebAppfromPortal

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:  
  - uses: actions/checkout@v2  

  - name: Set up Java version  
    uses: actions/setup-java@v1  
    with:  
      java-version: '11'  

  - name: Build with Maven  
    run: mvn clean install  

  - name: Upload artifact for deployment job  
    uses: actions/upload-artifact@v2  
    with:  
      name: java-app  
      path: '${{ github.workspace }}/target/*.war'  

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:  
  - name: Download artifact from build job  
    uses: actions/download-artifact@v2  
    with:  
      name: java-app  

  - name: Deploy to Azure Web App  
    id: deploy-to-webapp  
    uses: azure/webapps-deploy@v2  
    with:  
      app-name: 'JavaWebAppfromPortal'  
      slot-name: 'Production'  
      publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_######## }}  
      package: '*.war'
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,689 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 17,771 Reputation points
    2023-02-04T09:53:29.99+00:00

    Thanks for reaching here! Could you please follow the link here for maven build: https://azureossd.github.io/2017/05/09/azure-app-service-java-cicd-with-maven/

    0 comments No comments