在Maven发布期间跳过对结帐的测试:执行 [英] Skip tests on checkout during maven release:perform

查看:65
本文介绍了在Maven发布期间跳过对结帐的测试:执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Maven release:perform目标期间,正在从SCM中检出准备好的标签,并且似乎在派生的Maven实例中尝试构建.

During the maven release:perform goal, the prepared tag is being checked out from SCM and a build seems to be attempted in a forked maven instance.

我希望在那时跳过测试,因为无论出于何种原因,它们都会失败(构建涉及通过货运运行测试Web应用程序,我相信这在这种环境下无法正常工作)

I'd like the tests to be skipped at that point, because for whatever reason, they fail (the build involves running a test web-application via cargo, and I believe this just doesn't work well in this environment).

有什么方法可以指导Maven做到这一点吗?

Is there any way to instruct maven to do this?

推荐答案

您可以在命令行上为派生的maven实例指定参数:

You can specify arguments to the forked maven instance on the command line:

mvn release:prepare -Darguments="-DskipTests"
mvn release:perform -Darguments="-DskipTests"

或在pom中指定一个maven-release-plugin配置,可能在pluginManagement下:

or specify a maven-release-plugin configuration in your pom, perhaps under pluginManagement:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <configuration>
        <arguments>-DskipTests</arguments>
      </configuration>
    </plugin>

这篇关于在Maven发布期间跳过对结帐的测试:执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆