Java实战及解析 — Maven快速入门


class="video_iframe" height="375" width="500" frameborder="0" src="https://v.qq.com/iframe/preview.html?vid=p0318sl4jyn&width=500&height=375&auto=0" allowfullscreen="" style="line-height: 28.4444px; margin: 0px; padding: 0px; border-width: 0px; border-style: initial; width: 555.556px; position: static; z-index: 1; background-color: rgb(0, 0, 0);">

 

 五分钟快速入门 


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)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值