'maven project'에 해당되는 글 1건

  1. 2014.10.14 Apache Maven project configuration - 메이븐 설정
2014. 10. 14. 17:33

기본개념


아파치 메이븐은 프로젝트의 전체적인 생명주기를 관리해주는 자바 빌드 툴입니다.

메이븐을 통해 다양한 버전의 라이브러리 의존성 관리를 한번에 할 수 있습니다.

(광범위한 jar파일들을 쉽게 관리)

 

설치법


메이븐은 오픈 API 프로젝트이기 때문에 무료로 다운받을 수 있습니다.

톰캣서버를 키면 메이븐은 서버에서 pom.xml에 설정해 놓은 jar파일들을 자동으로 다운받아줍니다.

(다운로드 경로 : C:\apache-tomcat-7.0.xx\wtpwebapps\getMaven\WEB-INF\lib)

필요한 jar파일을 복사해서 스프링을 켜고 진행중인 프로젝트의 WEB-INF/lib에 붙여 넣습니다.


자세한 설치과정은 아래 캡처사진을 보며 따라해주세요.

 


[English]


Basic Concept


Apache maven is build tool for Java to manage overall life-cycle of your project. Maven automatically configures settings of across multiple versions about dependency relationship. You can manage wide jar files easily with this maven.

 

Installation usage


Maven is open API project so you can free download it.

If you run Tomcat server, Maven get jar files on Server and save your Tomcat folder.

You just copy the jar files into library of your project and start Spring.

(Download Path : C:\apache-tomcat-7.0.xx\wtpwebapps\getMaven\WEB-INF\lib)



Let's start while seeing some pictures!

 

Step1)

 

Make a maven project.

Right mouse click -> New -> Other




 

Step2)

 

Maven -> Maven Project -> Next


 

 

Step3)

 

Click the Next button.


 

 

Step4)

 

Group Id : org.apache.maven.archetypes

Artifact Id : maven-archetype-webapp

Version : RELEASE

-> Next



 



Step5)

 

Group Id : org.package-name(or org.company-name)

Artifact Id : getMaven

-> Next


메이븐은 전세계 개발자들과 다양한 프로젝트를 공유하는 것을 목적으로 하기 때문에 Group IDArtifact ID 설정을 해야 합니다.


Maven project is goal to share various projects with developers in the web-world.

This is why, we should do Group id and Artifact Id configuration.

 




 

Step6)

 

We can see getMaven Project in Project explorer. Go ahead, Double click pom.xml!

 



 

Step7)

 

Can you see this screen?  Good job! Go ahead next step.

 



 

Step8)

 

Search maven repository you need on http://mvnrepository.com.

Just copy dependency and paste on pom.xml.

 


Example)

<dependency>

<groupId>org.mybatis</groupId>

<artifactId>mybatis-spring</artifactId>

<version>x.x.x</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-context</artifactId>

<version>x.x.x.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-jdbc</artifactId>

<version>x.x.x.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-webmvc</artifactId>

<version>x.x.x.RELEASE</version>

</dependency>

 


Step9)

 

Run Tomcat server, so jar files are saved in your Tomcat folder.




 

Step10)

 

Finally, last step!!

 

Change your project to Spring project, and choose jar files saved in your Tomcat folder. Then Copy and Paste on WebContent/Web-INF/lib.







* 항상 인터넷이 연결되어 있어서 


서버에 연결할 때마다 lib 다운하도록 하기



Dynamic Web Project를 먼저 생성하고 해당 프로젝트 마우스 오른쪽 클릭





여기서부터는 위 Step5와 동일







Enjoy your programming life!!

 

Good luck.

 

By Luffy’s fafa


 

크리에이티브 커먼즈 라이선스


 

 

 

Posted by 루피아빠