Skip to content

Commit b373078

Browse files
committed
docs(notes): add web app deployment options guide
1 parent 967ff8c commit b373078

File tree

3 files changed

+87
-2
lines changed

3 files changed

+87
-2
lines changed

_posts/en/2025-01-11-notes-en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ generated: false
77
translated: false
88
---
99

10-
These 2134 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
10+
These 2135 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
1111

1212
* [Core Essentials of LLM Applications](/notes/2025-09-05-core-llm-essentials-en)
1313
* [Spring Web Application Setup Without Boot](/notes/2025-09-05-spring-webapp-setup-en)
14+
* [Web Application Deployment Options Explained](/notes/2025-09-05-web-app-deployment-options-en)
1415
* [Working Directory Importance for Coding Agents](/notes/2025-09-05-working-directory-importance-en)
1516
* [AI Model Context Window Capacities](/notes/2025-09-03-ai-model-context-window-en)
1617
* [Alphabet Hits $186.66B in H1 2025](/notes/2025-09-03-alphabet-h1-2025-revenue-en)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Web Application Deployment Options Explained
3+
lang: en
4+
layout: post
5+
audio: false
6+
translated: false
7+
generated: true
8+
image: false
9+
---
10+
11+
Got it — let me explain those options clearly for you.
12+
13+
### Option 1: Quick Development Setup (Recommended)
14+
15+
This is the easiest way to start the project during development.
16+
If your `pom.xml` includes a Tomcat or Jetty plugin, you can run the app directly with:
17+
18+
```bash
19+
mvn tomcat7:run
20+
```
21+
22+
or
23+
24+
```bash
25+
mvn jetty:run
26+
```
27+
28+
This launches the web app in an embedded Tomcat/Jetty without building a WAR or deploying manually. If you don’t already have the plugin, you’d need to add it to `pom.xml` first.
29+
30+
---
31+
32+
### Option 2: Build and Deploy WAR
33+
34+
This is the more “traditional” approach. You package the application into a WAR file:
35+
36+
```bash
37+
mvn clean package
38+
```
39+
40+
This produces something like `target/playground-server-1.0.war`.
41+
You then copy that WAR into a standalone Tomcat/Jetty server’s `webapps/` folder, restart the server, and access the deployed app in the browser.
42+
43+
---
44+
45+
### Option 3: Use Embedded Server (Manual Setup)
46+
47+
Currently your `Application.main()` just starts the Spring context — it doesn’t actually start a web server.
48+
If you want the app itself to launch Tomcat (without relying on an external one), you’d need to modify your main class to set up and start an embedded Tomcat instance programmatically.
49+
50+
This gives you a self-contained runnable JAR, but it requires extra setup code.
51+
52+
---
53+
54+
### Option 4: Spring Boot Migration
55+
56+
This project has **some Spring Boot test setup**, but isn’t a real Spring Boot app yet. That’s why running:
57+
58+
```bash
59+
mvn spring-boot:run
60+
```
61+
62+
doesn’t work.
63+
64+
If you want, you can migrate:
65+
66+
* Add the proper Spring Boot starter dependencies.
67+
* Change your main class to `@SpringBootApplication`.
68+
* Then you’d be able to just run with `mvn spring-boot:run` or even `java -jar target/app.jar`.
69+
70+
This is the most modern approach, but requires some changes to your code and `pom.xml`.
71+
72+
---
73+
74+
**In short**:
75+
76+
* If you just want to test quickly → use **Option 1**.
77+
* If you’re deploying to an existing server → use **Option 2**.
78+
* If you want a self-contained app without external Tomcat → use **Option 3**.
79+
* If you want to modernize and simplify long-term → use **Option 4**.
80+
81+
---
82+
83+
Do you want me to show you the **exact `pom.xml` snippet** for Option 1 (Tomcat/Jetty plugin) so you can just run `mvn tomcat7:run` right away?

original/2025-01-11-notes-en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ generated: false
77
translated: false
88
---
99

10-
These 2134 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
10+
These 2135 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
1111

1212
* [Core Essentials of LLM Applications](/notes/2025-09-05-core-llm-essentials-en)
1313
* [Spring Web Application Setup Without Boot](/notes/2025-09-05-spring-webapp-setup-en)
14+
* [Web Application Deployment Options Explained](/notes/2025-09-05-web-app-deployment-options-en)
1415
* [Working Directory Importance for Coding Agents](/notes/2025-09-05-working-directory-importance-en)
1516
* [AI Model Context Window Capacities](/notes/2025-09-03-ai-model-context-window-en)
1617
* [Alphabet Hits $186.66B in H1 2025](/notes/2025-09-03-alphabet-h1-2025-revenue-en)

0 commit comments

Comments
 (0)