跳过Maven测试依赖关系 [英] Skipping Maven Test Dependency

查看:216
本文介绍了跳过Maven测试依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个使用maven进行构建的项目。我想要做的是跳过测试依赖。基本上运行maven构建而不存在我的maven存储库中的工件。

I am working on a project that use maven for building. What I am trying to do is to skip the test dependency. Basically running the maven build without the presence of artifact in my maven repository.

例如

<artifactId>example</artifactId>
<scope>test</scope>

这是从我的项目的pom文件,我必须maven构建我的项目,而没有工件 example

This is from the pom file of my project and I have to maven build my project without having artifact example.

我已经搜索过解决方案,例如使用-DskipTests = true或-Dmaven.test.skip = true。在我的情况下,他们没有跳过测试的运行,但仍然抱怨缺少依赖文件。

I have searched for solution such as use "-DskipTests=true" or "-Dmaven.test.skip=true". In my case they did skip the running of the tests but it still complains missing dependency file.

有没有人知道运行maven构建的方法,而不必具有测试工件maven仓库?

Does anyone know a way to run maven build without having to have test artifact in the maven repository?

谢谢。

推荐答案

请参阅 http://jira.codehaus.org/browse/MNG-4192 。我认为唯一的办法是将测试范围的依赖关系移动到Maven配置文件中。

See http://jira.codehaus.org/browse/MNG-4192. I think the only way around it is to move the test-scoped dependency into a Maven profile.

这篇关于跳过Maven测试依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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