跳过Maven测试依赖关系

编程入门 行业动态 更新时间:2024-10-28 10:24:01
本文介绍了跳过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?

谢谢。

推荐答案

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

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

更多推荐

跳过Maven测试依赖关系

本文发布于:2023-11-25 17:07:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630609.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:跳过   关系   测试   Maven

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!