java 将 Maven 存储库添加到 settings.xml

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11454819/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 05:11:08  来源:igfitidea点击:

Adding a Maven repository to settings.xml

javamavenm2e

提问by Matthew Kemnetz

I am trying to add a repository to my settings.xml file so I can use the libraries in that repository in a project I am working on. here is my current settings.xml file.

我正在尝试向我的 settings.xml 文件添加一个存储库,以便我可以在我正在处理的项目中使用该存储库中的库。这是我当前的 settings.xml 文件。

<settings>
  .
  .

  <profiles>
    <profile>
      <id>standard-extra-repos</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      ...
      <repositories>

      <repository>
          <id>xuggle repo</id>
          <name>Xuggler Repository</name>
          <url>http://xuggle.googlecode.com/svn/trunk/repo/share/java/</url>
          <layout>default</layout>
          <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases>
          <snapshots><enabled>true</enabled><updatePolicy>never</updatePolicy></snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
      ...
      </pluginRepositories>

    </profile>
  </profiles>
  .
</settings>

I want to add the Xuggler repository to my settings.xml so I can search for the proper dependencies in M2E (Maven 2 Eclipse) and add them to my project. When I I go to windo->show view->Maven->maven repositories the xuggle repository is visible but completely empty. The Jars I need aren't being found.

我想将 Xuggler 存储库添加到我的 settings.xml 中,以便我可以在 M2E(Maven 2 Eclipse)中搜索正确的依赖项并将它们添加到我的项目中。当我转到windo->show view->Maven->maven repositories 时,xuggle 存储库是可见的但完全是空的。找不到我需要的罐子。

回答by Puce

The recommended way is to use a Maven Repository Manager such as Nexus to manage the repositories you need.

推荐的方法是使用 Maven 存储库管理器(例如 Nexus)来管理您需要的存储库。

See here how to configure the settings file: http://books.sonatype.com/nexus-book/reference/config-maven.html#ex-maven-nexus-simple

请参阅此处如何配置设置文件:http: //books.sonatype.com/nexus-book/reference/config-maven.html#ex-maven-nexus-simple

回答by Eugene Kuleshov

In order to support searchand browsing of remote repositories from m2e, repository has to provide m2e indexes. Here are somewhat outdated docs.

为了支持从 m2e搜索和浏览远程存储库,存储库必须提供 m2e 索引。这里有一些过时的文档