(maven) maven phase
maven에서 빌드를 하다보면 goal 을 입력해야하는 경우가 있는데 그냥 package 를 입력하면 jar를 생성해 주는것으로 생각해서 작업을 하곤 했는데, maven 홈페이지 가서 각 phase에 대한 내용을 발췌해왔다. 몇가지 살펴보면 package 는 당연히 compiled code 를 가지고 jar와 같은 배포형식으로 만든다고 되어 있다. install은 말 그대로 설치인데, package 된 것을 다른 프로젝트에서 사용할 수 있도록 (maven)local repository에 설치하는 것이라고 설정하고 있다. 제일 끝의 deploy 단계는 통합 또는 릴리즈 환경이 구축된 상태에서 최종 패키지를 개발자나 혹은 다른 프로젝트를 위해서 원격지의 저장소에 복사하는 것을 의미한다.
그리 길지 않은 영어라서 대충 읽어보면 알수 있을법한 내용들이다. 필자는 다른 프로젝트에서 dependency 할 일이 없이 jar 독립적으로 실행되는 형태를 많이 만들다 보니 package를 주로 쓰는데, 웹 파트 같은 경우에는 install 을 사용하기도 하는 것을 본지라 정리해 둔다.
Clean Lifecycle
pre-clean | executes processes needed prior to the actual project cleaning |
clean | remove all files generated by the previous build |
post-clean | executes processes needed to finalize the project cleaning |
*
Default Lifecycle
validate | validate the project is correct and all necessary information is available. |
initialize | initialize build state, e.g. set properties or create directories. |
generate-sources | generate any source code for inclusion in compilation. |
process-sources | process the source code, for example to filter any values. |
generate-resources | generate resources for inclusion in the package. |
process-resources | copy and process the resources into the destination directory, ready for packaging. |
compile | compile the source code of the project. |
process-classes | post-process the generated files from compilation, for example to do bytecode enhancement on Java classes. |
generate-test-sources | generate any test source code for inclusion in compilation. |
process-test-sources | process the test source code, for example to filter any values. |
generate-test-resources | create resources for testing. |
process-test-resources | copy and process the resources into the test destination directory. |
test-compile | compile the test source code into the test destination directory |
process-test-classes | post-process the generated files from test compilation, for example to do bytecode enhancement on Java classes. For Maven 2.0.5 and above. |
test | run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed. |
prepare-package | perform any operations necessary to prepare a package before the actual packaging. This often results in an unpacked, processed version of the package. (Maven 2.1 and above) |
package | take the compiled code and package it in its distributable format, such as a JAR. |
pre-integration-test | perform actions required before integration tests are executed. This may involve things such as setting up the required environment. |
integration-test | process and deploy the package if necessary into an environment where integration tests can be run. |
post-integration-test | perform actions required after integration tests have been executed. This may including cleaning up the environment. |
verify | run any checks to verify the package is valid and meets quality criteria. |
install | install the package into the local repository, for use as a dependency in other projects locally. |
deploy | done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects. |
*
Site Lifecycle
pre-site | executes processes needed prior to the actual project site generation |
site | generates the project’s site documentation |
post-site | executes processes needed to finalize the site generation, and to prepare for site deployment |
site-deploy | deploys the generated site documentation to the specified web server |