https://github.com/nesoy/springboot-starter-example
πΊ Introducing Springboot-starter
https://github.com/nesoy/springboot-starter-example
example spring
Last synced: 5 months ago
JSON representation
πΊ Introducing Springboot-starter
- Host: GitHub
- URL: https://github.com/nesoy/springboot-starter-example
- Owner: NESOY
- Created: 2020-06-21T08:18:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-09T10:44:00.000Z (over 5 years ago)
- Last Synced: 2025-06-02T21:09:41.041Z (8 months ago)
- Topics: example, spring
- Language: Java
- Homepage:
- Size: 747 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Spring-boot-Starter Tutorial
#### Goals
- Springboot Starterλ₯Ό μ§μ λ§λ€λ©΄μ μ΄λ»κ² ꡬμ±λμ΄ μλμ§ μ΄ν΄ν΄λ΄
μλ€.
## Let's make custom-springboot-starter
#### 1. Create Multi Moudle Project
- springboot-starterμ μμ λ₯Ό λ§λ€κΈ° μν΄μ μ΄ 3κ°μ§μ λͺ¨λμ΄ νμν©λλ€.
- μλ νκ²½μ€μ λͺ¨λ
- μλ νκ²½μ€μ μ ν¬ν¨ν λͺ¨λ
- Starterλ₯Ό ν
μ€νΈ νλ €λ Web Application
- [springboot-starter λͺ¨λμ μ΄λ¦μ μμ±νκΈ° μ μ μ£Όμν΄μΌ ν μ λ€μ΄ μμ΅λλ€.](https://docs.spring.io/autorepo/docs/spring-boot/2.0.0.M3/reference/html/boot-features-developing-auto-configuration.html#boot-features-custom-starter-naming)
- Springμμλ λͺ¨λμ μ΄λ¦μ `spring-boot`λ‘ μμνμ§ μμ κ²μ κΆνκ³ μμ΅λλ€.
- μλμ κ°μ΄ μμ λ€λ₯Έ μ΄λ¦μ λΆμ΄κΈ°λ₯Ό κΆνκ³ μμ΅λλ€.
- `nesoy-spring-boot-autoconfigure`
- `nesoy-spring-boot-starter`
- λ©ν° λͺ¨λλ‘ νλ‘μ νΈ κ΅¬μ±νκΈ°
- [MavenμΌλ‘ ꡬμ±ν΄λ³΄κΈ°](https://taetaetae.github.io/2020/01/19/spring-boot-maven-multi-module/)
- [Gradleλ‘ κ΅¬μ±ν΄λ³΄κΈ°](https://jojoldu.tistory.com/123)
- Gradleλ‘ κ΅¬μ±νλ©΄ λ€μκ³Ό κ°μ λͺ¨μ΅μ λ³Ό μ μμ΅λλ€.
```shell script
.
βββ 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μ μλ μ€μ μ μ¬μ©νκΈ° μν΄ μλμ μμ‘΄μ±μ μΆκ°ν΄μ€λλ€.
- [Springboot-AutoConfigure](https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure)
```shell script
# gradle
compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '2.3.1.RELEASE'
# Maven
org.springframework.boot
spring-boot-autoconfigure
2.3.1.RELEASE
```
- Starterμ νμν μ€μ νμΌμ λ§λ€μ΄λ΄
μλ€.
- [@ConfigurationProperties](https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/properties/ConfigurationProperties.html)
- [Reference](https://velog.io/@max9106/Spring-Boot-%EC%99%B8%EB%B6%80%EC%84%A4%EC%A0%95-4xk69h8o50)
```java
@ConfigurationProperties(prefix = "nesoy")
public class NesoyProperties {
private String log;
public String getLog() {
return log;
}
public void setLog(String log) {
this.log = log;
}
}
```
## μλ νκ²½μ€μ μ ν¬ν¨ν λͺ¨λ μ
ν
## μ°λ¦¬κ° λ§λ Starter μ¬μ©ν΄λ³΄κΈ°
## Reference
-
-
-
-