├── 1,txt
├── 2.txt
├── 3.txt
├── Jenkinsfile
├── pom.xml
├── src
└── main
│ ├── java
│ └── com
│ │ └── abhishek
│ │ └── StartApplication.java
│ └── resources
│ ├── application.properties
│ ├── static
│ ├── css
│ │ └── main.css
│ └── js
│ │ └── main.js
│ └── templates
│ └── index.html
└── steps.md
/1,txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/2.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/3.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Jenkinsfile:
--------------------------------------------------------------------------------
1 | pipeline {
2 | agent any
3 | tools{
4 | jdk 'jdk11'
5 | maven 'maven3'
6 | }
7 |
8 | stages {
9 | stage('Git checkout') {
10 | steps {
11 | git branch: 'main', changelog: false, poll: false, url: 'https://github.com/jaiswaladi246/springboot-java-poject.git'
12 | }
13 | }
14 |
15 | stage('Compile') {
16 | steps {
17 | sh "mvn compile"
18 | }
19 | }
20 |
21 | stage('Package') {
22 | steps {
23 | sh "mvn clean package"
24 |
25 | }
26 | }
27 |
28 |
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.abhishek
8 | spring-boot-demo
9 | 1.0
10 |
11 | spring-boot-demo
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter-parent
17 | 2.2.4.RELEASE
18 |
19 |
20 |
21 | UTF-8
22 | 11
23 | 11
24 | 11
25 |
26 |
27 |
28 |
29 |
30 | org.springframework.boot
31 | spring-boot-starter-web
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-thymeleaf
36 |
37 |
38 | org.springframework.boot
39 | spring-boot-starter-test
40 | test
41 |
42 |
43 |
44 |
45 | org.springframework.boot
46 | spring-boot-devtools
47 | true
48 |
49 |
50 |
51 |
52 |
53 |
54 | spring-boot-web
55 |
56 |
57 |
58 | org.springframework.boot
59 | spring-boot-maven-plugin
60 |
61 |
62 | org.apache.maven.plugins
63 | maven-compiler-plugin
64 | 3.8.0
65 |
66 | ${java.version}
67 | ${java.version}
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/src/main/java/com/abhishek/StartApplication.java:
--------------------------------------------------------------------------------
1 | package com.abhishek;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.stereotype.Controller;
6 | import org.springframework.ui.Model;
7 | import org.springframework.web.bind.annotation.GetMapping;
8 |
9 | @SpringBootApplication
10 | @Controller
11 | public class StartApplication {
12 |
13 | @GetMapping("/")
14 | public String index(final Model model) {
15 | model.addAttribute("title", "This is a SpringBoot Static Web Application");
16 | model.addAttribute("msg", "Application Is Deployed To Kuberneets");
17 | return "index";
18 | }
19 |
20 | public static void main(String[] args) {
21 | SpringApplication.run(StartApplication.class, args);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # nothing here yet
2 |
--------------------------------------------------------------------------------
/src/main/resources/static/css/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 5rem;
3 | }
4 | .starter-template {
5 | padding: 3rem 1.5rem;
6 | text-align: center;
7 | }
--------------------------------------------------------------------------------
/src/main/resources/static/js/main.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaiswaladi246/springboot-java-poject/56cbf1f14541f7018bc7ef2ddefa13b9b4201e42/src/main/resources/static/js/main.js
--------------------------------------------------------------------------------
/src/main/resources/templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Build & Deploy SpringBoot Based Static Web Application
8 |
9 |
10 |
11 |
14 |
15 |
16 |
17 |
Default title.
18 |
Default text.
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/steps.md:
--------------------------------------------------------------------------------
1 | ## https://www.youtube.com/@devopsshack
2 | ## Learn DevOps in 30 Days at https://www.youtube.com/watch?v=9q1DnI8MoIE&list=PLAdTNzDIZj_8BerYwx-rUjmVkj6A9vD9_&pp=gAQBiAQB
3 | ## To Build & Run This project, follow the steps.
4 |
5 | --> Clone the Project
6 |
7 | --> Go to Root directly of the project
8 |
9 | --> Run "mvn clean package"
10 |
11 | --> Run "java -jar target/jar_file_name.jar"
12 |
13 | --> Access the Application at IP:8080
14 |
--------------------------------------------------------------------------------