mac下使用brew安装maven并使用mvn dependency:tree,mvn spring-boot:run --debug命令运行spring boot

一、使用brew命令搜索maven版本

 

yaomingyangdeMacBook-Pro:conf yaomingyang$ brew search maven
==> Searching local taps...
maven               maven-shell         [email protected]           [email protected]
maven-completion    [email protected]           [email protected] ✔
==> Searching taps on GitHub...
caskroom/fonts/font-maven-pro
==> Searching blacklisted, migrated and deleted formulae...


二、使用命令安装maven3.2

 

 

brew install [email protected]


三、验证是否安装成功

 

 

yaomingyangdeMacBook-Pro:conf yaomingyang$ mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T01:29:23+08:00)
Maven home: /usr/local/Cellar/[email protected]/3.2.5/libexec
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.1", arch: "x86_64", family: "mac"


四、如果想卸载安装的maven可以使用如下的命令

 

 

brew uninstall [email protected]


五、使用mvn dependency:tree命令查看spring boot项目依赖的包结构

 

 

yaomingyangdeMacBook-Pro:ggauthority yaomingyang$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ggauthority 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:3.0.1:tree (default-cli) @ ggauthority ---
[INFO] ggauthority.v1:ggauthority:jar:0.0.1-SNAPSHOT
[INFO] \- org.springframework.boot:spring-boot-starter-web:jar:2.0.0.BUILD-SNAPSHOT:compile
[INFO]    +- org.springframework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.springframework.boot:spring-boot:jar:2.0.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.0.BUILD-SNAPSHOT:compile
[INFO]    |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO]    |  |  |  +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO]    |  |  |  \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO]    |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO]    |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO]    |  +- javax.annotation:javax.annotation-api:jar:1.3.1:compile
[INFO]    |  +- org.springframework:spring-core:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO]    |  |  \- org.springframework:spring-jcl:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO]    |  \- org.yaml:snakeyaml:jar:1.18:runtime
[INFO]    +- org.springframework.boot:spring-boot-starter-json:jar:2.0.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.1:compile
[INFO]    |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO]    |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.9.1:compile
[INFO]    |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.1:compile
[INFO]    |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.1:compile
[INFO]    |  +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.1:compile
[INFO]    |  \- com.fasterxml.jackson.module:jackson-module-kotlin:jar:2.9.1:compile
[INFO]    +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
[INFO]    |  |  \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
[INFO]    |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
[INFO]    |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
[INFO]    +- org.hibernate.validator:hibernate-validator:jar:6.0.2.Final:compile
[INFO]    |  +- javax.validation:validation-api:jar:2.0.0.Final:compile
[INFO]    |  +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO]    |  \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO]    +- org.springframework:spring-web:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO]    |  \- org.springframework:spring-beans:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO]    \- org.springframework:spring-webmvc:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO]       +- org.springframework:spring-aop:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO]       +- org.springframework:spring-context:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO]       \- org.springframework:spring-expression:jar:5.0.1.BUILD-SNAPSHOT:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.660 s
[INFO] Finished at: 2017-10-14T12:35:18+08:00
[INFO] Final Memory: 23M/437M
[INFO] ------------------------------------------------------------------------


六、使用spring maven 插件包含的mvn spring-boot:run命令快速的编译和运行spring boot项目,使用 mvn spring-boot:run --debug调试项目

 

 

 

你可能感兴趣的:(【Git/Maven】)