“λ 립μ μΌλ‘ μ€νκ°λ₯ν μ ν리μΌμ΄μ ”μ΄ μ€νλ§λΆνΈμ μ£Όμν λͺ©μ μ€ νλμ΄λ€.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
pom.xmlμ spring-boot-maven-pluginμ΄ ν΄μ£Όλ μΌμ΄ λ°λ‘ ν¨ν€μ§μ΄λ€.
jar μμ jar νμΌλ€μ κ·Έλλ‘ λ¬Άμ΄λ μ μλλ‘ μ§μν΄μ νλμ jar νμΌλ‘ νλ‘μ νΈλ₯Ό ν¨ν€μ§ν μ μλ€.
λͺ¨λ mvn λͺ λ Ήμ΄λ νλ‘μ νΈμ ν λλ ν 리μμ μ€ννλ©΄ λλ€.
μλλ λνμ μΌλ‘ μ°μ΄λ λͺ λ Ήμ΄λ€μ΄λ€.
mvn clean
mvn package γ ‘> μ€ν κ°λ₯ν JAR νμΌ “νλκ°" μμ±λλ€.
mvn clean package γ ‘> ν λ²μ μ€νν μλ μλ€.
mvn package -DskipTests γ ‘> testλ 건λλ΄λ€.
java -jar μμ±λ_jar_νμΌ_μ΄λ¦ γ ‘> μ€ννλ€.
μμΆμ ν΄μ νμ λ
λ΄μ₯ JAR : κΈ°λ³Έμ μΌλ‘ μλ°μλ λ΄μ₯ JARλ₯Ό λ‘λ©νλ νμ€μ μΈ λ°©λ²μ΄ μλ€.
μ ν리μΌμ΄μ ν΄λμ€(classes)μ λΌμ΄λΈλ¬λ¦¬(lib) μμΉλ₯Ό ꡬλΆνκ³ μλ κ²μ λ³Ό μ μλ€.
org.springframework.boot.loader.jar.JarFileμ μ¬μ©ν΄μ λ΄μ₯ JARλ₯Ό μ½λλ€.
org.springframework.boot.loader.Launcherλ₯Ό μ¬μ©ν΄μ μ€ννλ€.
[ MANIFEST.MF ]
Manifest-Version: 1.0
Spring-Boot-Classpath-Index: BOOT-INF/classpath.idx
Implementation-Title: demo
Implementation-Version: 0.0.1-SNAPSHOT
Spring-Boot-Layers-Index: BOOT-INF/layers.idx
Start-Class: com.jueun.demo.Application
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
Build-Jdk-Spec: 1.8
Spring-Boot-Version: 2.4.1
Created-By: Maven Jar Plugin 3.2.0
Main-Class: org.springframework.boot.loader.JarLauncher
λͺ¨λ jar νμΌλ€μ μμμ μ META-INF/MANIFEST.MF νμΌμ΄λ€.
Main-Classμλ λ΄μ₯ Jarμ΄ μλ, bootκ° μ 곡νλ JarLauncherκ° μ§μ λμ΄ μλ€.
Start-Classμλ λ΄κ° μμ±ν λ©μΈ ν΄λμ€κ° μ§μ λμ΄ μλ€.
'Springboot' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
@Profile (0) | 2021.01.08 |
---|---|
[spring boot] μΈλΆ μ€μ (0) | 2021.01.08 |
SpringApplication (0) | 2021.01.06 |
μ€νλ§ λΆνΈ ν¬νΈ λ²νΈ λ³κ²½, λλ€ν¬νΈ, ν¬νΈ λ²νΈ νμΈνκΈ° (0) | 2021.01.05 |
μ€νλ§ λΆνΈμ λ΄μ₯λ tomcat μλ² λ³κ²½νλ λ² (0) | 2021.01.05 |
μ€νλ§ λΆνΈμ λ΄μ₯ μΉ μλ²(λ μλ°ν λ§νλ©΄ WAS)μ λνμ¬ (0) | 2021.01.05 |