mvn package vs springboot:repackage

This commit is contained in:
Kai Yuan 2020-12-23 00:04:10 +01:00
parent 89d10ea819
commit 76778779dd
6 changed files with 85 additions and 0 deletions

View File

@ -24,6 +24,7 @@
<module>spring-boot-angular</module>
<module>spring-boot-annotations</module>
<module>spring-boot-artifacts</module>
<module>spring-boot-artifacts-2</module>
<module>spring-boot-autoconfiguration</module>
<module>spring-boot-basic-customization</module>
<module>spring-boot-basic-customization-2</module>

View File

@ -0,0 +1,7 @@
## Spring Boot Artifacts 2
This module contains articles about configuring the Spring Boot build process 2.
### Relevant Articles:
TBD

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.baeldung.spring-boot-modules</groupId>
<artifactId>spring-boot-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>spring-boot-artifacts-2</artifactId>
<packaging>jar</packaging>
<name>spring-boot-artifacts-2</name>
<description>Demo project for Spring Boot</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<!-- The main class to start by executing java -jar -->
<start-class>com.baeldung.demo.DemoApplication</start-class>
</properties>
</project>

View File

@ -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);
}
}

View File

@ -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<String> welcomeEndpoint() {
return ResponseEntity.ok("Welcome to Baeldung Spring Boot Demo!");
}
}

View File

@ -0,0 +1,3 @@
spring:
application:
name: Baeldung_SpringBoot_Demo