아파치 메이븐
(
Apache Maven
)은
자바
프로젝트들을 위한
빌드 自動化
道具이다. 메이븐은
C 샤프
,
루비
,
스칼라
等의 言語로 開發된 프로젝트들을 빌드하고 管理하기 위해 使用할 수도 있다. 메이븐 프로젝트는
아파치 소프트웨어 財團
에 依해 호스팅되며 이 財團은 한때
자카르타 프로젝트
의 一部였다.
文法
[
編輯
]
수많은 프로젝트들은 프로젝트 오브젝트 모델(Project Object Model, POM)을 使用하여 構成되며 pom.xml 파일에 貯藏된다. 파일 內容은 다음과 같다:
<project>
<!-- model version is always 4.0.0 for Maven 2.x POMs -->
<modelVersion>
4.0.0
</modelVersion>
<!-- project coordinates, i.e. a group of values which uniquely identify this project -->
<groupId>
com.mycompany.app
</groupId>
<artifactId>
my-app
</artifactId>
<version>
1.0
</version>
<!-- library dependencies -->
<dependencies>
<dependency>
<!-- coordinates of the required library -->
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
3.8.1
</version>
<!-- this dependency is only used for running and compiling tests -->
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
위의 POM은 프로젝트의 固有 識別子(coordinates)와
JUnit
프레임워크의 依存性만을 定義한다.
디렉터리 이름
|
目的
|
프로젝트 홈
|
pom.xml과 모든 下位 디렉터리를 包含한다.
|
src/main/java
|
프로젝트의 傳達 可能한 자바 소스 코드를 包含한다.
|
src/main/resources
|
屬性(property) 파일 等 프로젝트의 傳達 可能한 리소스를 包含한다.
|
src/test/java
|
프로젝트의 테스팅 자바 소스 코드(예: JUnit, TestNG)를 包含한다.
|
src/test/resources
|
테스트에 必要한 리소스를 包含한다.
|
같이 보기
[
編輯
]
各州
[
編輯
]
外部 링크
[
編輯
]