You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/includes/quickstart-java/quickstart-java-jboss.md
+85-77Lines changed: 85 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,90 +3,97 @@ author: cephalin
3
3
ms.service: azure-app-service
4
4
ms.devlang: java
5
5
ms.topic: include
6
-
ms.date: 04/23/2025
6
+
ms.date: 06/10/2025
7
7
ms.author: cephalin
8
8
---
9
9
10
-
In this quickstart, you'll use the [Maven Plugin for Azure App Service Web Apps](https://github.com/microsoft/azure-maven-plugins/blob/develop/azure-webapp-maven-plugin/README.md) to deploy a Java web application to a Linux JBoss EAP server in [Azure App Service](/azure/app-service/). App Service provides a highly scalable, self-patching web app hosting service. Use the tabs to switch between Tomcat, JBoss, or embedded server (Java SE) instructions.
10
+
[Azure App Service](/azure/app-service/) provides a highly scalable, self-patching web app hosting service. In this quickstart, you use the [Maven Plugin for Azure App Service Web Apps](https://github.com/microsoft/azure-maven-plugins/blob/develop/azure-webapp-maven-plugin/README.md) to deploy a Java web application to a Linux JBoss EAP server in Azure App Service.
11
11
12
-

13
-
14
-
If Maven isn't your preferred development tool, check out our similar tutorials for Java developers:
- Run the commands in this quickstart by using Azure Cloud Shell, an interactive shell that you can use through your browser to work with Azure services. To use Cloud Shell:
25
23
26
-
## 2 - Create a Java app
24
+
1. Select the following **Launch Cloud Shell** button or go to https://shell.azure.com to open Cloud Shell in your browser.
25
+
26
+
:::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
27
27
28
-
Clone the Pet Store demo application.
28
+
1. Sign in to Azure if necessary, and make sure you're in the **Bash** environment of Cloud Shell.
29
+
1. Select **Copy** in a code block, paste the code into Cloud Shell, and run it.
Change directory to the completed pet store project and build it.
33
+
1. Clone the Pet Store demo application.
35
34
36
-
> [!TIP]
37
-
> The `petstore-ee7` sample requires **Java 11 or newer**. The `booty-duke-app-service` sample project requires **Java 17**. If your installed version of Java is less than 17, run the build from within the `petstore-ee7` directory, rather than at the top level.
1. Change directory to the completed `petstore-ee7` project and build it.
45
40
46
-
If you see a message about being in **detached HEAD** state, this message is safe to ignore. Because you won't make any Git commit in this quickstart, detached HEAD state is appropriate.
41
+
```bash
42
+
cd app-service-java-quickstart
43
+
git checkout 20230308
44
+
cd petstore-ee7
45
+
mvn clean install
46
+
```
47
47
48
-
## 3 - Configure the Maven plugin
48
+
If you see a message about being in detached HEAD state, you can ignore it. You don't make any Git commit in this quickstart, so detached HEAD state is appropriate.
49
+
50
+
> [!TIP]
51
+
> The `petstore-ee7` sample requires Java 11 or newer. The `booty-duke-app-service` sample project requires Java 17. If your installed version of Java is less than 17, run the build from within the *petstore-ee7* directory instead of at the top level.
49
52
50
-
The deployment process to Azure App Service uses your Azure credentials from the Azure CLI automatically. If the Azure CLI isn't installed locally, then the Maven plugin authenticates with OAuth or device sign-in. For more information, see [authentication with Maven plugins](https://github.com/microsoft/azure-maven-plugins/wiki/Authentication).
53
+
## Configure the Maven plugin
51
54
52
-
Run the Maven command shown next to configure the deployment. This command helps you to set up the App Service operating system, Java version, and Tomcat version.
55
+
The App Service deployment process uses your Azure credentials from Cloud Shell automatically. The Maven plugin authenticates with OAuth or device sign-in. For more information, see [Authentication](https://github.com/microsoft/azure-maven-plugins/wiki/Authentication).
53
56
54
-
```azurecli-interactive
57
+
Run the following Maven command to configure the deployment by setting the App Service operating system, Java version, and Jbosseap version.
After you've confirmed your choices, the plugin adds the above plugin element and requisite settings to your project's `pom.xml` file that configure your web app to run in Azure App Service.
86
-
87
-
The relevant portion of the `pom.xml` file should look similar to the following example.
88
-
89
-
```xml-interactive
63
+
1. For **Create new run configuration**, type **Y** and then press **Enter**.
64
+
1. For **Define value for OS**, type **2** for Linux, and then press **Enter**.
65
+
1. For **Define value for javaVersion**, type **2** for Java 17, and then press **Enter**. If you select Java 21, you don't see **Jbosseap** as an option later.
66
+
1. For **Define value for webContainer**, type **4** for Jbosseap 7, and then press **Enter**.
67
+
1. For **Define value for pricingTier**, type **1** for P1v3, and then press **Enter**.
68
+
1. For **Confirm**, type **Y** and then press **Enter**.
69
+
70
+
The output should look similar to the following code:
After you confirm your choices, the plugin adds the plugin element and required settings to your project's *pom.xml* file, which configures your web app to run in App Service.
93
+
94
+
The relevant portion of the *pom.xml* file should look similar to the following example.
95
+
96
+
```xml
90
97
<build>
91
98
<plugins>
92
99
<plugin>
@@ -95,43 +102,44 @@ The relevant portion of the `pom.xml` file should look similar to the following
You can modify the configurations for App Service directly in your `pom.xml`.
114
+
The values for `<appName>` and `<resourceGroup>`, `petstoreee7-1745409173307` and `petstoreee7-1745409173307-rg` in the demo app, are used later.
115
+
116
+
You can modify the configurations for App Service directly in your *pom.xml* file.
108
117
109
118
- For the complete list of configurations, see [Common Configurations](https://github.com/microsoft/azure-maven-plugins/wiki/Common-Configuration).
110
119
- For configurations specific to App Service, see [Azure Web App: Configuration Details](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App:-Configuration-Details).
111
120
112
-
Be careful about the values of `<appName>` and `<resourceGroup>` (`petstoreee7-1745409173307` and `petstoreee7-1745409173307-rg` accordingly in the demo). They're used later.
121
+
## Deploy the app
113
122
114
-
## 4 - Deploy the app
123
+
With all the configuration ready in your *pom.xml* file, you can deploy your Java app to Azure with the following single command.
115
124
116
-
With all the configuration ready in your *pom.xml* file, you can deploy your Java app to Azure with one single command.
117
-
118
-
```azurecli-interactive
125
+
```bash
119
126
# Disable testing, as it requires Wildfly to be installed locally.
120
127
mvn package azure-webapp:deploy -DskipTests
121
128
```
122
129
123
-
Once you select from a list of available subscriptions, Maven deploys to Azure App Service. When deployment completes, your application is ready. In this demo, the URL is `http://petstoreee7-1745409173307.azurewebsites.net`. Open the URL with your local web browser, you should see
130
+
Once you select from a list of available subscriptions, Maven deploys to Azure App Service. When deployment completes, your application is ready.
131
+
132
+
For this demo app, the URL is `http://petstoreee7-1745409173307.azurewebsites.net`. When you open the URL with your local web browser, you should see the following app:
124
133
125
134

126
135
127
-
**Congratulations!** You've deployed your first Java app to App Service.
136
+
Congratulations! You deployed a Java app to App Service.
128
137
129
-
## 5 - Clean up resources
138
+
## Clean up resources
130
139
131
-
In the preceding steps, you created Azure resources in a resource group. If you don't need the resources in the future, delete the resource group from portal, or by running the following command in the Cloud Shell:
140
+
You created the resources for this tutorial in an Azure resource group. If you no longer need them, you can delete the resource group and all its resources by running the following Azure CLI command in Cloud Shell.
132
141
133
-
```azurecli-interactive
134
-
az group delete --name <your resource group name; for example: petstoreee7-1745409173307-rg> --yes
142
+
```azurecli
143
+
az group delete --name petstoreee7-1745409173307-rg --yes
0 commit comments