Maven 왜 써야하나



1. 기존방식


레파지토리 관리 문제


프로젝트 폴더의 properties > Java Build Path > Libraries > Add External JARs 를 통해 자신이 필요한 jar 파일을 구해 추가해야 했다.


초기 개발 환경설정에 어려움이 생길 뿐만 아니라 이후 유지보수나 추가개발 시 jar 파일을 다운받고 서로의 버전을 맞춰야 하는 문제가 발생했다.



2. Maven 쓰고 난 다음 방식


https://mvnrepository.com/


접속하여 자신이 필요한 jar 파일 이름 키워드를 검색하면


.jar로 제공되는 많은 maven 정보가 뜨게 되고


메이븐을 사용하여


pom.xml 안에 



1
2
3
4
5
6
7
8
9
10
11
12
13
14
<dependencies>
    <!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>3.1.11</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
    <dependency>
        <groupId>com.googlecode.json-simple</groupId>
        <artifactId>json-simple</artifactId>
        <version>1.1.1</version>
    </dependency>
</dependencies>
cs


간단하게 문장 몇줄만 적어주게 되면 Maven Dependencies 안에 .jar 파일을 모두 받아온다.




+ Recent posts