[Spring] Intro
in Tech-Stack on Spring
Spring framework
eclipse์์ spring์ ํ์ฉํ ํ๋ก์ ํธ ๋ง๋ค๊ธฐ
create new Maven Project๋ฅผ ํตํด ํ๋ก์ ํธ๋ฅผ ์์ฑํ๋ค.- Maven Project : build ๋๊ตฌ๋ก maven์ ์ฌ์ฉํ๋ฉฐ ์ด ์์์ spring์ ์ฌ์ฉํ ์ ์๋ค.-
create a simple project๋ฅผ ์ฒดํฌํ๋ค.
- ํ๋ก์ ํธ์ ์ด๋ฆ, ํจํค์ง ๋ฐฉ์ ๋ฑ์ ์ค์ ํ๋ค.
artifact id: ํ๋ก์ ํธ ์ด๋ฆpackaging: ํจํค์ง ๋ฐฉ์. ์ผ๋จ์ jar์ ์ฌ์ฉํ๊ณ ์ดํ์ ๋ฐ๊ฟ ์์
- ํ๋ก์ ํธ๋ฅผ ์์ฑํ๋ฉด ๋ค์๊ณผ ๊ฐ์ด ๋๋ ํ ๋ฆฌ๊ฐ ๊ตฌ์ฑ๋๋ค.
- pom.xml : eclipse๊ฐ maven ํ๋ก์ ํธ๋ก ์ธ์ํ๊ธฐ ์ํ ์ค์ ํ์ผ
- Maven Project : build ๋๊ตฌ๋ก maven์ ์ฌ์ฉํ๋ฉฐ ์ด ์์์ spring์ ์ฌ์ฉํ ์ ์๋ค.-
- pom.xml ์์
- pom.xml์ ์์ ํ ๋ค
update Maven์ ํตํด ์ค์ ์ ์ ์ฉํด์ผํ๋ค. - ์ผ๋ฐ์ ์ผ๋ก ๋ค์ 3๊ฐ์ ์ค์ ์ ์์ /์ถ๊ฐํ๋ค.
- Maven ์ค์ ํ์ผ
- ์์กด๋ผ์ด๋ธ๋ฌ๋ฆฌ
<!-- Spring framework ๋ถ๋ฌ์ค๊ธฐ --> <dependencies> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.0.8.RELEASE</version> </dependency> </dependencies> - ๋น๋์ค์
<build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <encoding>utf-8</encoding> </configuration> </plugin> </plugins> </build>
- pom.xml์ ์์ ํ ๋ค
