MAVEN共享模块,带有测试实用程序
我怀疑哪种解决方案最好在Maven模块之间共享实用程序。
问题在于,我们有2个API类型模块的2个Maven模块,以及另一个由这两个模块使用的逻辑的“共享”模块。 在此“共享”模块中,还有用于测试的实用程序类,例如,在其他模块中使用的抽象类“ MockMvctest.java”可用于不重复代码。所有类是直接共享的,未在测试软件包中声明,也不是作为测试共享的。也就是说,在此“共享”模块测试依赖项中,例如“ Junit-vintage-engine”,不能具有“测试”范围。
这个“共享”模块最终包含带有测试实用程序,安全性,映射器等的软件包。 我怀疑是否可以在此“共享”模块中混合“正常”和“测试”逻辑并与其他模块共享,还是更好地创建另一个模块?
非常感谢您
I have a doubt about which solution is better to share utilities between maven modules.
The problem is that we have 2 maven modules for 2 api type modules and another "shared" module with logic used by those two modules.
In this "shared" module there are also utility classes for tests, for example, an abstract class "MockMvcTest.java" that are used in the other modules to not repeat code. All classes are shared directly, are not declared within test packages, and are not shared as tests. That is, in this "shared" module test dependencies, such as "junit-vintage-engine", cannot have "test" scope.
This "shared" module ends up containing packages with test utilities, security, mappers, etc.
I have doubts about whether it is okay to mix "normal" and "test" logic in this "shared" module and share it with the other modules or would be better to create another module?
Thank you very much in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论