diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..e303311 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..63e9001 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..9dc782b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 823a73d..cc81fbf 100644 --- a/pom.xml +++ b/pom.xml @@ -1,44 +1,87 @@ - + + 4.0.0 - SpringBootMavenExample + + com.javabycode.springboot + springboot-maven-example + 1.0.1 + jar + SpringBootMavenExample - SpringBootMavenExample - war + Spring Boot Hello World Example (Java 17, Spring Boot 3.3.4) + org.springframework.boot spring-boot-starter-parent - 1.3.5.RELEASE + 3.3.4 + - 1.7 + 17 + UTF-8 + org.springframework.boot spring-boot-starter-web + org.springframework.boot - spring-boot-starter-tomcat - provided + spring-boot-starter-thymeleaf + - org.apache.tomcat.embed - tomcat-embed-jasper - provided + org.springframework.boot + spring-boot-starter-actuator + + + + + org.springframework.boot + spring-boot-starter-test + test + + + scm:git:https://github.com/vishnu/springboot-maven-example.git + scm:git:ssh://git@github.com:vishnu/springboot-maven-example.git + https://github.com/vishnu/springboot-maven-example + + + org.springframework.boot spring-boot-maven-plugin + + + + org.codehaus.mojo + buildnumber-maven-plugin + 3.2.0 + + + validate + + create + + + + - \ No newline at end of file + + diff --git a/src/main/java/com/javabycode/springboot/HelloWorldController.java b/src/main/java/com/javabycode/springboot/HelloWorldController.java index a8f11ba..bc2360b 100644 --- a/src/main/java/com/javabycode/springboot/HelloWorldController.java +++ b/src/main/java/com/javabycode/springboot/HelloWorldController.java @@ -1,19 +1,22 @@ package com.javabycode.springboot; + import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller public class HelloWorldController { - @RequestMapping("/hello") - public String hello(Model model, @RequestParam(value="name", required=false, defaultValue="World") String name) { - - String message="You just create Spring Boot Example successfully"; + + @GetMapping("/hello") + public String hello(Model model, + @RequestParam(value = "name", required = false, defaultValue = "World") String name) { + + String message = "You just created a Spring Boot Example successfully!"; model.addAttribute("name", name); model.addAttribute("message", message); - - return "hello"; + + return "hello"; // Points to hello.html (Thymeleaf) } } diff --git a/src/main/java/com/javabycode/springboot/MyWebApplication.java b/src/main/java/com/javabycode/springboot/MyWebApplication.java index c8c210b..f91ae42 100644 --- a/src/main/java/com/javabycode/springboot/MyWebApplication.java +++ b/src/main/java/com/javabycode/springboot/MyWebApplication.java @@ -2,19 +2,13 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.context.web.SpringBootServletInitializer; - @SpringBootApplication -public class MyWebApplication extends SpringBootServletInitializer{ - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(MyWebApplication.class); - } - - public static void main(String[] args) throws Exception { +public class MyWebApplication { + public static void main(String[] args) { SpringApplication.run(MyWebApplication.class, args); + System.out.println("✅ Spring Boot Application started successfully!"); + } } diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100644 index 0000000..b416f5e --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1,2 @@ +spring.mvc.view.prefix: / +spring.mvc.view.suffix: .jsp \ No newline at end of file diff --git a/target/classes/com/javabycode/springboot/HelloWorldController.class b/target/classes/com/javabycode/springboot/HelloWorldController.class new file mode 100644 index 0000000..dc31cc9 Binary files /dev/null and b/target/classes/com/javabycode/springboot/HelloWorldController.class differ diff --git a/target/classes/com/javabycode/springboot/MyWebApplication.class b/target/classes/com/javabycode/springboot/MyWebApplication.class new file mode 100644 index 0000000..d5b0574 Binary files /dev/null and b/target/classes/com/javabycode/springboot/MyWebApplication.class differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..d66e65b --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=springboot-maven-example +groupId=com.javabycode.springboot +version=1.0.1 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..f7524b1 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com\javabycode\springboot\HelloWorldController.class +com\javabycode\springboot\MyWebApplication.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..d91fb9d --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Vishnu\Desktop\Node JS\spring-boot-maven-example-helloworld\src\main\java\com\javabycode\springboot\HelloWorldController.java +C:\Users\Vishnu\Desktop\Node JS\spring-boot-maven-example-helloworld\src\main\java\com\javabycode\springboot\MyWebApplication.java diff --git a/target/springboot-maven-example-1.0.1.jar b/target/springboot-maven-example-1.0.1.jar new file mode 100644 index 0000000..c599bb8 Binary files /dev/null and b/target/springboot-maven-example-1.0.1.jar differ diff --git a/target/springboot-maven-example-1.0.1.jar.original b/target/springboot-maven-example-1.0.1.jar.original new file mode 100644 index 0000000..00bf9c0 Binary files /dev/null and b/target/springboot-maven-example-1.0.1.jar.original differ