Javawebappsample
Java web app samples for Jenkins on Azure
Install / Use
/learn @azure-devops/JavawebappsampleREADME
A Simple Java Web App for Azure
Build
mvn package
Run Locally
mvn jetty:run
To run in a different port
mvn jetty:run -Djetty.port=<your port>
Debug Locally
set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
mvn jetty:run
Deploy to Azure Web App using FTP
Rename the .war file in target folder to ROOT.war and upload it to your Azure Web App through Git or FTP.
Containerize Your Web App
- Build a docker image using
Dockerfile:docker build -t calculator . - Run docker image locally
docker run --rm -p 8080:8080 calculator - Then you can access the web app at http://localhost:8080 in browser
Deploy to Azure Web App using Container Image
- Create a Container Registry on Azure
- Push your local image to ACR:
docker login -u <client id> -p <client secret> <your ACR server> docker tag calculator <your ACR server>/calculator docker push <your ACR server>/calculator - Create a Web App in Linux on Azure
- In Docker Container settings of Web App, fill in image name, server URL, username and password of your ACR.
- Save the changes and you'll be able to access the web app in a few seconds.
Setup Continous Integration with Azure using Jenkins
-
Go to Settings -> Integration & services, click Add service, choose Jenkins (GitHub plugin), fill in Jenkins hook url with
http://<your jenkins server>/github-webhook/ -
Make sure your Jenkins has the following components installed:
- JDK
- Maven
- Docker
And the following plugins installed:
- Azure credentials
- Docker pipeline
- Credentials binding
-
To deploy using FTP, create a Jenkins pipeline with
Jenkinsfileas pipeline file. -
To deploy using container, create a Jenkins pipeline with
Jenkinsfile2as pipeline file.
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
