NESOY / springboot-starter-example

🌺 Introducing Springboot-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring-boot-Starter Tutorial

Goals

  • Springboot Starterλ₯Ό 직접 λ§Œλ“€λ©΄μ„œ μ–΄λ–»κ²Œ κ΅¬μ„±λ˜μ–΄ μžˆλŠ”μ§€ μ΄ν•΄ν•΄λ΄…μ‹œλ‹€.

Let's make custom-springboot-starter

1. Create Multi Moudle Project

.
β”œβ”€β”€ build.gradle
β”œβ”€β”€ nesoy-spring-boot-autoconfigure -> μžλ™ ν™˜κ²½μ„€μ •μ„ μœ„ν•œ λͺ¨λ“ˆ
β”‚   β”œβ”€β”€ build.gradle
β”‚   └── src
β”œβ”€β”€ nesoy-spring-boot-starter-example -> μžλ™ ν™˜κ²½μ„€μ •μ„ ν¬ν•¨ν•œ λͺ¨λ“ˆ
β”‚   └── build.gradle
β”œβ”€β”€ nesoy-spring-boot-starter-web -> Starter ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•œ μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜
β”‚   β”œβ”€β”€ build.gradle
β”‚   └── src
└── settings.gradle

2. Setting Auto-Configure Module 🐳

  • Springboot의 μžλ™ 섀정을 μ‚¬μš©ν•˜κΈ° μœ„ν•΄ μ•„λž˜μ˜ μ˜μ‘΄μ„±μ„ μΆ”κ°€ν•΄μ€λ‹ˆλ‹€.
# gradle
compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '2.3.1.RELEASE'

# Maven
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId>
    <version>2.3.1.RELEASE</version>
</dependency>
@ConfigurationProperties(prefix = "nesoy")
public class NesoyProperties {

    private String log;

    public String getLog() {
        return log;
    }

    public void setLog(String log) {
        this.log = log;
    }
}

μžλ™ ν™˜κ²½μ„€μ •μ„ ν¬ν•¨ν•œ λͺ¨λ“ˆ μ…‹νŒ…

μš°λ¦¬κ°€ λ§Œλ“  Starter μ‚¬μš©ν•΄λ³΄κΈ°

Reference

About

🌺 Introducing Springboot-starter


Languages

Language:Java 100.0%