From 76778779dd6eec6f66ac94520a808b977cfdedcc Mon Sep 17 00:00:00 2001 From: Kai Yuan Date: Wed, 23 Dec 2020 00:04:10 +0100 Subject: [PATCH] mvn package vs springboot:repackage --- spring-boot-modules/pom.xml | 1 + .../spring-boot-artifacts-2/README.md | 7 +++ .../spring-boot-artifacts-2/pom.xml | 48 +++++++++++++++++++ .../com/baeldung/demo/DemoApplication.java | 11 +++++ .../com/baeldung/demo/DemoRestController.java | 15 ++++++ .../src/main/resources/application.yml | 3 ++ 6 files changed, 85 insertions(+) create mode 100644 spring-boot-modules/spring-boot-artifacts-2/README.md create mode 100644 spring-boot-modules/spring-boot-artifacts-2/pom.xml create mode 100644 spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoApplication.java create mode 100644 spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoRestController.java create mode 100644 spring-boot-modules/spring-boot-artifacts-2/src/main/resources/application.yml diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index 825af8fb9e..c562d522e2 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -24,6 +24,7 @@ spring-boot-angular spring-boot-annotations spring-boot-artifacts + spring-boot-artifacts-2 spring-boot-autoconfiguration spring-boot-basic-customization spring-boot-basic-customization-2 diff --git a/spring-boot-modules/spring-boot-artifacts-2/README.md b/spring-boot-modules/spring-boot-artifacts-2/README.md new file mode 100644 index 0000000000..80e3d95d14 --- /dev/null +++ b/spring-boot-modules/spring-boot-artifacts-2/README.md @@ -0,0 +1,7 @@ +## Spring Boot Artifacts 2 + +This module contains articles about configuring the Spring Boot build process 2. + +### Relevant Articles: + +TBD \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-artifacts-2/pom.xml b/spring-boot-modules/spring-boot-artifacts-2/pom.xml new file mode 100644 index 0000000000..abea13151e --- /dev/null +++ b/spring-boot-modules/spring-boot-artifacts-2/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ + + + spring-boot-artifacts-2 + jar + + spring-boot-artifacts-2 + Demo project for Spring Boot + + + + org.springframework.boot + spring-boot-starter-web + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + + + com.baeldung.demo.DemoApplication + + + diff --git a/spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoApplication.java b/spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoApplication.java new file mode 100644 index 0000000000..177d3c834e --- /dev/null +++ b/spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoApplication.java @@ -0,0 +1,11 @@ +package com.baeldung.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } +} diff --git a/spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoRestController.java b/spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoRestController.java new file mode 100644 index 0000000000..0869927926 --- /dev/null +++ b/spring-boot-modules/spring-boot-artifacts-2/src/main/java/com/baeldung/demo/DemoRestController.java @@ -0,0 +1,15 @@ +package com.baeldung.demo; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DemoRestController { + + @GetMapping(value = "/welcome") + public ResponseEntity welcomeEndpoint() { + return ResponseEntity.ok("Welcome to Baeldung Spring Boot Demo!"); + } + +} diff --git a/spring-boot-modules/spring-boot-artifacts-2/src/main/resources/application.yml b/spring-boot-modules/spring-boot-artifacts-2/src/main/resources/application.yml new file mode 100644 index 0000000000..3cd1d2e797 --- /dev/null +++ b/spring-boot-modules/spring-boot-artifacts-2/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + application: + name: Baeldung_SpringBoot_Demo \ No newline at end of file