본문 바로가기

Framework/eGovFrame

[ eGovframework ] Apache Maven 이란 ?

[ eGovframework ] Apache Maven ? -번외


Apache Maven 


아파치 메이븐은 아파치 라이선스 2.0 라이선스로 배포되는 오픈 소스 소프트웨어이고, 프로젝트 객체 모델(POM, Project Object Model)이라는 개념을 바탕으로 프로젝트 의존성 관리, 라이브러리 관리, 프로젝트 생명 주기 관리 기능 , 보고 및 문서관리 등을 제공하는 프로젝트 관리 도구이다. 또한 플러그인을 기반으로 소스 코드로부터 배포 가능한 산출물을 만들어 내는 빌드 기능 뿐만 아니라 레포팅 및 documentation 작성 기능 등을 제공합니다.

Apache Maven is open source software distributed under the Apache License 2.0 license and provides project dependency management, library management, project lifecycle management, reporting and document management based on the concept of Project Object Model (POM). Is a project management tool. It also provides reporting and documentation creation capabilities, as well as build capabilities that produce distributable deliverables from source code based on plug-ins.


빌드 툴의 기능을 가지고 있다면, Apache Ant 와의 차이점은 무엇인가 ?  

Ant 는 자바에서 사용하는 대표적인 자동화 소프트웨어 빌드 툴입니다. 빌드와 배포뿐만아니라, 유닛 테스트 등의 통합 툴로 발전하고 있는 빌드 툴입니다. Ant의 경우에, 사용자가 소스코드의 위치, 빌드된 파일의 위치, 그에 따른 산출물의 위치를 지정해주는 복잡하지만, 자유로운 빌드방식을 가지고 있는 반면, Maven의 경우, 이미 짜여진 빌드방식에 맞춰, 사용자가 맞춰서 작업하기만 하면 되기 때문에, 자유도는 떨어지지만, 간단하게 pom.xml 파일을 조작하는 것만으로 해결 할 수 있게 됩니다. 

빌드의 측면에서는 비교를 할  수 있을지 모르겠지만, Ant는 빌드 툴이라는 목적을 가지고 있으며, Maven의 경우 빌트 툴을 겸비한, 프로젝트 관리도구로서의 목적을 지니고 있습니다. 빌드라는 측면에서는, Ant < Maven 라는 수식이 붙을 것 같지만, 애초에 둘은 다른 성격을 띄고있는 툴이기 때문에 비교를 하시기보다는, 필요에 부합하는 툴을 사용하는 것이 맞을 것 같습니다. 다른 툴인거지요.

* 이 포스팅에서는 Maven 에 대한 포스팅이므로, Ant 관련 내용은 이정도만 서술하여 놓도록 하겠습니다. 


If you have the functionality of a build tool, what is the difference with Apache Ant?

Ant is a typical automation software build tool used in Java. It is a build tool that has developed into an integrated tool such as unit testing as well as building and distribution. In the case of Ant, you have a complicated but free build method that specifies the location of the source code, the location of the built files, and the resulting artifacts, whereas in Maven, Because you only have to work together, the degree of freedom is reduced, but you can easily fix it by simply manipulating the pom.xml file.

I do not know if I can make comparisons in terms of builds, but Ant has the purpose of being a build tool, and Maven has the purpose of being a project management tool with built-in tools. In terms of builds, Ant <Maven is likely to have a formula, but since they are different in nature in the first place, it is better to use tools that meet your needs rather than compare them. It's another tool.

This is a post about Maven in this post, so I'll leave it to you with an explanation of what Ant is about.



Maven 의 목표

빌드 프로세스의 간편화를 통해 개발자에게 편리하고, 빠른 빌드 기능 제공, 그리고 프로젝트 정보를 제공하고, 개발자가 전체 개발 과정을 한눈에 볼 수 있도록 하기 위한 프로젝트 관리 도구의 목적을 가지고 있다. 쉽게 말해서 JAVA 빌드 툴 & 프로젝트 관리 툴 인 것이다.


Goals of Maven The purpose of the project management tool is to provide the developer with convenience, rapid build function, project information, and to allow the developer to see the entire development process at a glance through simplification of the build process. In short, it is a JAVA build tool & project management tool.


Maven 의 장단점

장점

  • 뛰어난 의존성 관리 ( Dependency )

 - Dependency Library 관리 기능을 제공하기 때문에, pom.xml 에 dependency 에 추가(선언)만 하여도, 필요한 라이브러리를 다운받거나, 업데이트를 받을 수 있기 때문에 편하게 사용 가능하다. 또한, 라이브러리와 버전을 한눈에 효과적으로 컨트롤할 수 있기 때문에 개발자에게 편의를 제공한다.
  • 간편한 플러그인 사용 ( 확장성 )

 - Maven은 플러그인 실행 프레임워크이며, 플러그인은 goal 의 집합이다.
 - 플러그인은 다른 산출물 (artifacts) 와 같이 저장소에서 관리가 된다. 
  • 모든 프로젝트에 걸쳐 일관된 사용법

 - Maven 프로젝트의 경우 공통 구성을 가지는 템플릿 프로젝트를 생성할 수 있는데, 이러한 프로젝트 뼈대를 가짐으로써, 누구든지 해당 프로젝트의       구조가 Maven 프로젝트임을 인지할 수 있고, 프로젝트를 이해에 , 접근에 용이성을 준다.
  • 간단한 설정을 통한 배포 관리

  • JAVA , C++ 등의 다수의 프로그래밍 언어 지원


단점
  • Repository 관리의 불편함

  • pom.xml 관리

 - pom.xml 에 프로젝트 관리에 대한 모든 내용을 서술하기 때문에, 파일이 길어 질 수 있음.
  • 프로젝트에 특화된 복잡한 빌드 기능 제약

 - 짜여진 라이프 사이클이 제공되어 있기 때문에, 여러 빌드 환경에서의 다양한 빌드 지원이 미약.


Advantages and Disadvantages of Maven

 - Advantages

Superior dependency management (Dependency)

 - Because it provides dependency library management function, it can be easily used because it can download necessary libraries or receive updates even if it is added (declared) to dependency in pom.xml. It also provides developers with convenience because they can effectively control the library and version at a glance.

Easy plug-in use (scalability)

 - Maven is a plugin execution framework, and plugin is a set of goals.

 - Plugins are managed in repositories like other artifacts.

Consistent usage across all projects

 - In the case of Maven project, you can create a template project with a common structure. By having this project framework, anyone can recognize that the structure of the project is a Maven project, and it is easy to understand and access the project.

Manage deployment with simple settings

Supports many programming languages ​​such as JAVA and C ++


- Disadvantages

Discomfort in managing repositories

Manage pom.xml

 - Because pom.xml describes everything about project management, the file can be long.

Project-specific complex build feature constraints

 - Because there is a woven life cycle, various build support in several build environment is weak.



Maven 의 LifeCycle



Maven 아키텍쳐 






* 참고 

http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:dev:dep:build:maven

- https://maven.apache.org/

https://www.slideshare.net/sunnykwak90/ss-43767933