在Maven测试范围内运行时,如何在提供的范围内排除依赖项? [英] How do I exclude a dependency in provided scope when running in Maven test scope?

查看:148
本文介绍了在Maven测试范围内运行时,如何在提供的范围内排除依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Maven测试范围内运行时,如何在提供的范围内排除依赖项?我有一个不寻常的用例,其中我需要排除提供的特定实现,并在测试用例中将其替换为另一个.看来,Maven测试也总是包含其他范围,但就我而言,我想作一些例外.我该怎么做?

How do I exclude a dependency in provided scope when running in Maven test scope? I have an unusual use case where I need to exclude a particular provided implementation and replace it with another in the test cases. It seems that Maven tests always include other scopes as well but in my case I want to make some exception. How do I do this?

推荐答案

在某些情况下,您需要在其他模块中运行测试.那可能就是您在这里所需要的.它允许您的测试使用不同的依赖关系,属性和Java版本等.

There are situations where you need to run your tests in a different module. That may be what you need here. It allows your tests to use different dependencies, properties and version of Java etc.

这篇关于在Maven测试范围内运行时,如何在提供的范围内排除依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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