[Spring] Intro


Spring framework

eclipse์—์„œ spring์„ ํ™œ์šฉํ•œ ํ”„๋กœ์ ํŠธ ๋งŒ๋“ค๊ธฐ

  1. create new Maven Project๋ฅผ ํ†ตํ•ด ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
    • Maven Project : build ๋„๊ตฌ๋กœ maven์„ ์‚ฌ์šฉํ•˜๋ฉฐ ์ด ์•ˆ์—์„œ spring์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.- create a simple project๋ฅผ ์ฒดํฌํ•œ๋‹ค.
      intro01
    • ํ”„๋กœ์ ํŠธ์˜ ์ด๋ฆ„, ํŒจํ‚ค์ง• ๋ฐฉ์‹ ๋“ฑ์„ ์„ค์ •ํ•œ๋‹ค. intro02
      • artifact id : ํ”„๋กœ์ ํŠธ ์ด๋ฆ„
      • packaging : ํŒจํ‚ค์ง• ๋ฐฉ์‹. ์ผ๋‹จ์€ jar์„ ์‚ฌ์šฉํ•˜๊ณ  ์ดํ›„์— ๋ฐ”๊ฟ€ ์˜ˆ์ •
    • ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ๊ตฌ์„ฑ๋œ๋‹ค. intro03
      • pom.xml : eclipse๊ฐ€ maven ํ”„๋กœ์ ํŠธ๋กœ ์ธ์‹ํ•˜๊ธฐ ์œ„ํ•œ ์„ค์ • ํŒŒ์ผ
  2. pom.xml ์ˆ˜์ •
    • pom.xml์„ ์ˆ˜์ •ํ•œ ๋’ค update Maven์„ ํ†ตํ•ด ์„ค์ •์„ ์ ์šฉํ•ด์•ผํ•œ๋‹ค.
    • ์ผ๋ฐ˜์ ์œผ๋กœ ๋‹ค์Œ 3๊ฐœ์˜ ์„ค์ •์„ ์ˆ˜์ •/์ถ”๊ฐ€ํ•œ๋‹ค.
      1. Maven ์„ค์ •ํŒŒ์ผ
      2. ์˜์กด๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
         <!-- 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>
        
      3. ๋นŒ๋“œ์„ค์ •
         <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>
        








ยฉ 2022. by Yejin Ha

Powered by JihyunRyu