Maven-设置查询 [英] Maven - a set-up query

查看:103
本文介绍了Maven-设置查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给一组开发人员,每个开发人员对各自的(本地)Windows计算机具有以下要求:

Given a group of developers, each one has the following requirements on the respective (local)Windows machines:

  1. 通过Eclipse,STS等IDE,运行Spring,Hibernate等项目
  2. 快速构建,部署,运行,更改(如果需要),重新构建和重新部署(最好通过IDE进行)Github上可用的项目

有以下约束/目标:

  1. 各个开发者机器的互联网访问受到限制或没有访问权限
  2. 开发人员必须从一个位置获取所需的jar,这将在团队中存储所需的jars
  3. 无论何时需要,开发人员都必须能够将更新的jar从中央位置拖到他的本地环境中,并继续无缝地运行项目
  4. 在IDE中,构建一个Github项目并运行(本地)

随附的图像可以使我清楚地了解我所设想的工作环境!

Attached is the image to give a clear idea of the work environment which I'm envisaging!

我已经开始阅读Maven,但不知所措-我应该如何进行?

I have started reading Maven but quite overwhelmed - how should I proceed?

推荐答案

正如Sander Verhagen在另一个答案中所建议的,您应该做的是使用存储库代理. Nexus和Artifactory是最著名的.在这里,我将简要介绍您要寻找的步骤:

As suggested by Sander Verhagen in another answer, what you should do is to use a repository proxy. Nexus and Artifactory is the most famous one. Here I will describe briefly steps you need to do for what you are looking for:

  1. 在机器M中设置Nexus
  2. 在Nexus中,将代理存储库设置为Central(应该是开箱即用的),以及要开发人员访问的其他存储库.配置回购代理时,可能需要添加http代理设置.
  3. (可选,但建议使用)设置一个存储库组,其中包括所有公共存储库代理.假设此代理组的URL为http://M/nexus/groups/public
  4. 在开发人员的计算机上,更新〜/.m2/settings.xml,将http://M/nexus/groups/public设置为中心的镜像.如果您在Nexus中创建了其他内部托管存储库,则也可以将它们添加到settings.xml中.
  1. Set up Nexus in machine M
  2. In Nexus, setup a proxy repository to Central (this should be available out of box), and other repositories that you want your developer to access. You may need to add http proxy setting when you are configuring the Repo Proxy.
  3. (Optional, but recommended) setup a repository group which includes all the public repository proxies. Assuming URL of this proxy group is http://M/nexus/groups/public
  4. In developer's machine, update ~/.m2/settings.xml, set http://M/nexus/groups/public as the mirror of central. If you created other internal hosted repositories in Nexus, you may add them in settings.xml as well.

仅此而已.您可以照常使用Maven.现在,可以从M中的Nexus获取依赖项.

That's all. You can use Maven as normal. Dependencies will now be fetched from Nexus in M.

这篇关于Maven-设置查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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