maven mvn 命令行 编译打包项目(实践)

参考资料:https://blog.csdn.net/fareast_mzh/article/details/81463831

* 一行命令

    # 切换到项目根目录
    mvn clean && mvn compile && mvn package && start target

 

* 配置好jdk

 maven教程

* 下载安装maven  

http://maven.apache.org/download.cgi

apache-maven-3.3.3-bin.zip

 

* 解压到G:\apache-maven-3.5.3-bin

 

* 添加环境变量

** 添加 M2_HOME 和 MAVEN_HOME 环境变量到 Windows 环境变量,并将其指向你的 Maven 文件夹

** Path环境变量添加 %M2_HOME%\bin

 

* 查看mvn版本

mvn -version

Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: G:\apache-maven-3.5.3-bin\bin\..
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_131\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

 

* mvn编译打包

** 先把命令行切换到Maven项目的根目录

cd G:\eclipse-workspace\platform\enso-admin

** 编译

 mvn clean compile

output:

    [WARNING]
    [WARNING] Some problems were encountered while building the effective settings
    [WARNING] Unrecognised tag: 'distributionManagement' (position: START_TAG seen ...</pluginRepositories>\r\n      <distributionManagement>... @304:31)  @ C:\Users\13352\.m2\settings.xml, line 304, column 31
    [WARNING]
    [INFO] Scanning for projects...
    [WARNING]
    [WARNING] Some problems were encountered while building the effective model for com.tsinghuadtv.enso:enso-admin:war:1.0
    [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.codehaus.jackson:jackson-core-asl:jar -> duplicate declaration of version 1.9.12 @ line 156, column 15
    [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.codehaus.jackson:jackson-mapper-lgpl:jar -> duplicate declaration of version 1.9.12 @ line 161, column 15
    [WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 283, column 12
    [WARNING]
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING]
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [WARNING]
    [INFO]
    [INFO] ------------------< com.tsinghuadtv.enso:enso-admin >-------------------
    [INFO] Building enso-admin 1.0
    [INFO] --------------------------------[ war ]---------------------------------
    [WARNING] The POM for commons-logging:commons-logging:jar:1.1.3 is invalid, transitive dependencies

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值