๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ปWEB BackEnd/ํ”„๋ ˆ์ž„์›Œํฌ Spring

ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ - (๋ฐฉ๋ฒ•1)eclipse์—์„œ ์ƒ์„ฑ

๋ชฉ์ฐจ

  • ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
  • pom.xml ์ž‘์„ฑ
  • ํด๋” ๋ฐ pom.xmlํŒŒ์ผ์˜ ์ดํ•ด

 

ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

Maven์„ ์ด์šฉํ•ด์„œ ์Šคํ”„๋ง ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑ

ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์™„๋ฃŒ!

 

 

pom.xml ํŒŒ์ผ

pom.xmlํŒŒ์ผ์€ Maven ์„ค์ •ํŒŒ์ผ๋กœ, Maven์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์—ฐ๊ฒฐํ•ด์ฃผ๊ณ , ๋นŒ๋“œ๋ฅผ ์œ„ํ•œ ํ”Œ๋žซํผ์ด๋‹ค.

  • Maven์˜ ๋นŒ๋“œ ์ •๋ณด๋ฅผ ๋‹ด๊ณ ์žˆ๋Š” ํŒŒ์ผ
  • POM(Project Object Model)์„ ์„ค์ •ํ•˜๋Š” ๋ถ€๋ถ„
  • ํ”„๋กœ์ ํŠธ ๋‚ด์˜ ๋นŒ๋“œ ์˜ต์…˜์„ ์„ค์ •ํ•˜๋Š” ๋ถ€๋ถ„

 

pom.xml ํŒŒ์ผ ์ž‘์„ฑ

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>spring4</groupId>
  <artifactId>testPjt</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</project>

์— ์•„๋ž˜์™€ ๊ฐ™์ด <dependencies>, <target> ์ฝ”๋“œ ๋ถ€๋ถ„ ์ถ”๊ฐ€

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>spring4</groupId>
  <artifactId>testPjt</artifactId>
  <version>0.0.1-SNAPSHOT</version>

	<dependencies>
	    <dependency>
	        <groupId> org.springframework </groupId>
	        <artifactId>spring-context</artifactId>
	        <version> 4.1.0.RELEASE </version>
	    </dependency>
	</dependencies>
	
	<build>
	    <plugins>
	        <plugin>
	            <artifactId>maven-compiler-plugin</artifactId>
	            <version>3.1</version>
	            <configuration> 
	                <source> 1.8 </source>
	                <target> 1.8 </target>
	                <encoding> utf 8 </encoding>
	            </configuration>
	        </plugin>
	    </plugins>
	</build>
</project>

 

 

 

ํด๋” ๊ตฌ์กฐ

testPjt : ํ”„๋กœ์ ํŠธ root

testPjt /src /main /java ํด๋” : .javaํŒŒ์ผ ๊ด€๋ฆฌ

testPjt /src /main /resourses ํด๋” : ์ž์›ํŒŒ์ผ(xmlํŒŒ์ผ ๋˜๋Š” ํ”„๋กœํผํ‹ฐ ํŒŒ์ผ ๋“ฑ) ๊ด€๋ฆฌ