简体   繁体   English

嵌入式Maven远程存储库

[英]embedded maven remote repository

I am writing a scala client that should perform several reads from maven remote repository (dependency tree evaluation). 我正在编写一个scala客户端,该客户端应该从maven远程存储库执行几次读取(依赖树评估)。

To perform e2e tests to my code I need a running maven repository (artifactory, nexus, archiva etc...) with several artifacts deployed. 为了对我的代码执行e2e测试,我需要一个运行着的maven存储库(artifactory,nexus,archiva等),并部署了多个工件。

I am looking for a way I can use test utility that will allow me to start embedded server with code configured artifacts and dependency relationship. 我正在寻找一种使用测试实用程序的方法,该实用程序将允许我使用配置了代码的工件和依赖关系来启动嵌入式服务器。 That way I can set it up just before my test, use it and stop it. 这样,我可以在测试之前进行设置,使用并停止它。

If possible - I want to avoid using filesystem 如果可能的话-我想避免使用文件系统

Of course - that library can be either scala or java 当然-该库可以是Scala或Java

There is a MockRepositoryServer in the Mojohaus project run by the Maven committers and others that does what you need. 由Maven提交者和其他人运行的Mojohaus项目中有一个MockRepositoryServer,它可以满足您的需求。 It is specifically designed for that exact testing purpose. 它是专门为该精确测试目的而设计的。

You can also use a full blown Nexus Repository Manager in a local install. 您还可以在本地安装中使用功能齐全的Nexus Repository Manager。 Either will work. 两者都会起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM