[maven]常用命令

利用maven命令 打包

打包某一个服务
这里写图片描述
打包的是local里面的配置文件,即:
这里写图片描述
Windows 命令:
这里写图片描述

e:
cd E:\Computer\JavaItoo\ITOO-Dubbo\achievement-parent
mvn clean install -Dmaven.test.skip=true 

打包dev里面的配置文件内容,即:
这里写图片描述
Windows 命令
这里写图片描述

e:
cd E:\Computer\JavaItoo\ITOO-Dubbo\achievement-parent
mvn clean install -Dmaven.test.skip=true -P dev

强制获取私服上更新的内容
Mvn package –U
一次性打包所有itoo服务
添加一个pom文件
pom内容
这里写图片描述

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <parent>
        <groupId>com.dmsdbj.itoo</groupId>
        <artifactId>itoo-root</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <groupId>com.dmsdbj.itoo</groupId>
    <artifactId>itoo-parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <modelVersion>4.0.0</modelVersion>


    <modules>
        <module>achievement-parent</module>
        <module>authorityManagement-parent</module>
        <module>basicInfo-parent</module>
        <module>examinationEvaluation-parent</module>
        <module>itooCloud-parent</module>
        <module>shiro-jwt-authority</module>
        <module>singleTableMaintain-parent</module>
        <module>teachingManagement-parent</module>
    </modules>


</project>

打包命令

mvn clean install -Dmaven.test.skip=true -fail-never

这个命令用来检查代码编译是否报错,-fail-never出错了也可以继续执行后面的编译.
这里写图片描述

创建maven的普通java项目
mvn archetype:create
-DgroupId=packageName
-DartifactId=projectName

创建maven的web项目
mvn archetype:create
-DgroupId=packageName
-DartifactId=webappName
-DarchetypeArtifactId=maven-archetype-webapp

发布第三方jar到私服上
mvn deploy:deploy-file -DgroupId=org.csource -DartifactId=fastdfs-client-java -Dversion=1.27 -Dpackaging=jar -Dfile=E:\fastdfs-client-java-1.27.jar -Durl=http://ip:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

发布第三方jar到本地库
mvn install:install-file -DgroupId=org.csource -DartifactId=fastdfs-client-java -Dversion=1.27 -Dpackaging=jar -Dfile=E:\fastdfs-client-java-1.27.jar -Durl=http://ip:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 34
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 34
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阳光下是个孩子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值