maven手动安装依赖并跳过测试代码 Failed to collect dependencies at。。

maven笔记

打包时候提示一些错误,诸如:

Failed to collect dependencies at ....

提示找不到依赖包,这个时候需要手动安装,去这里https://mvnrepository.com可以搜寻到依赖。

手动安装jar

mvn install:install-file -DgroupId=io.grpc -DartifactId=grpc-core -Dversion=1.24.0 -Dpackaging=jar -Dfile=C:\Users\mis\Downloads\grpc-core-1.24.0.jar

通过-U命令强制从远程仓库重新下载相关的dependency

mvn -U clean install: -U,–update-snapshots Forces a check for updated releases and snapshots on remote

跳过测试代码

mvn clean install -Dskip Tests
mvn -Prelease-nacos -Dmaven.test.skip=true -Dpmd.skip=true -Dcheckstyle.skip=true -Drat.skip=true clean install -U  
-Dmaven.test.skip=true,不执行测试用例,也不编译测试用例类
-DskipTests 跳过单元测试,但是会继续编译

如果不在命令行中跳过,也可以在配置文件中跳过

<plugins>
        <plugin>
            <groupId>org.apache.maven.plugin</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.1</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
    </plugins>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值