Java實戰及解析 — Maven快速入門


 

 五分鐘快速入門 


mvn --version

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

-X -DarchetypeCatalog=internal

cd my-app

mvn package

java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App

 

http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

 

Maven標準目錄佈局



http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

 

Maven快速入門

 

Maven 階段(Phrases)

 

validate: validate the project is correct and all necessary information is available

 

compile: compile the source code of the project

 

test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed

package: take the compiled code and package it in its distributable format, such as a JAR.

 

integration-test: process and deploy the package if necessary into an environment where integration tests can be run

 

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.

 

clean: cleans up artifacts created by prior builds

 

site: generates site documentation for this project

 

Maven快速入門


mvn clean dependency:copy-dependencies package

 

This command will clean the project, copy dependencies, and package the project (executing all phases up to package, of course).

 

mvn site

 

This phase generates a site based upon information on the project's pom. You can look at the documentation generated under target/site.



歡迎加入程序員的世界,添物科技爲您服務。

歡迎關注添物網的微信(微信號:tianwukeji),微博(weibo.com/91tianwu/),或下載添物APP,及時獲取最新信息。
免費加入QQ羣:557373922(內有乾貨)。
添物網(http://www.91tianwu.com)出品
轉載聲明:本文系添物網原創出品,轉載本文請標明出處,完整標註來源[添物網],(包括鏈接http://www.91tianwu.com)


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章