简体   繁体   English

在企业环境中分发maven settings.xml文件

[英]Distributing the maven settings.xml file in corporate environment

We want to deploy maven in our company, and we are wondering what's the best way to distribute the file settings.xml and maybe associated data to each developer. 我们想在我们公司部署maven,我们想知道将文件settings.xml和相关数据分发给每个开发人员的最佳方法是什么。 We see these constraints: 我们看到这些限制:

  • We want a ' batteries included ' strategy': The minimal amount of work to set up a correct environment. 我们想要“ 包含电池 ”策略':设置正确环境的最小工作量。
  • We have roaming profiles , so we can't store the full maven repository cache in the profile (need for creating a folder for this cache outside the profile) 我们有漫游配置文件 ,因此我们无法在配置文件中存储完整的maven存储库缓存(需要在配置文件外部为此缓存创建文件夹)
  • We want to push little updates to this file without destroying local modifications (so no overwrite, but eg a subversion merge would be usable) 我们希望在不破坏本地修改的情况下对该文件进行少量更新(因此不会覆盖,但是例如可以使用subversion合并)
  • We want to use developer-style tools only, so we don't depend on the windows guys with all associated overhead of a release to push a little change (using GPOs or SMS to push this file is not preferred) 我们只想使用开发人员风格的工具,所以我们不依赖于windows版本的所有相关开销来推动一点变化(使用GPO或SMS推送此文件不是首选)

So how does your company handle this? 那么贵公司如何处理这个问题呢?

Put the settings.xml in a version control system, we use Git, we tell the repository to ignore the repository directory in ~/.m2 in a .gitignore file and then just pull the settings.xml file on a regular basis from a central remote repository, in our case a private Gitorious` server. settings.xml放在版本控制系统中,我们使用Git,我们告诉存储库忽略.gitignore文件中~/.m2中的repository目录,然后从中心定期拉出settings.xml文件远程存储库,在我们的例子中是一个私有的Gitorious服务器。

Once this file is set up and working once, it is rare that it should ever change in most cases. 一旦这个文件被设置并运行一次,在大多数情况下它很少会发生变化。 So just putting the settings.xml file on a wiki and having the user install it when they are installing the version control software and Maven isn't much of an extra burden. 因此,只需将settings.xml文件放在wiki上,让用户在安装版本控制软件时安装它,Maven就不会有太大的负担。

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

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