简体   繁体   English

Netbeans添加新的Maven远程存储库

[英]Netbeans add new Maven remote repository

How to add new remote repo to the NetBeans 7.2 for using with the Dependency window (with repo indexing)? 如何将新的远程仓库添加到NetBeans 7.2以使用“依赖关系”窗口(使用repo索引)?

I found http://wiki.magnolia-cms.com/display/WIKI/setting+up+Netbeans+with+the+Magnolia+maven+repository but in 7.2 NB this window moved. 我找到了http://wiki.magnolia-cms.com/display/WIKI/setting+up+Netbeans+with+++Magnolia+maven+repository,但是在7.2 NB这个窗口移动了。

In the Dependency there are no button for adding new remote Maven repos. 在Dependency中没有用于添加新远程Maven repos的按钮。 I need to add http://repo1.maven.org/maven2/org/mortbay/jetty/jetty/7.0.0.pre5/ to the NetBeans. 我需要将http://repo1.maven.org/maven2/org/mortbay/jetty/jetty/7.0.0.pre5/添加到NetBeans中。

Sorry my bad English. 抱歉,我的英语不好。

Thanks, Arthur. 谢谢,亚瑟。

here is easy method- 这里很简单 -

Go to Services>Maven Repositories. Right Click>Add Repository 

在此输入图像描述

You can edit settings.xml file in maven and add your repository to it. 您可以在maven中编辑settings.xml文件并将其存储库添加到其中。 You should add something like: 你应该添加如下内容:

<repositories>
    <repository>
        <id>nexus</id>
        <name>Repository for JDK 1.6 builds</name>
        <url>http://myrepo1:1111/contextpath/</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>nexus-major</id>
        <name>Repository for JDK 1.6 builds 2</name>
        <url>http://myrepo1:1111/contextpath2/</url>
        <layout>default</layout>
    </repository>
</repositories>

But this code should be wrapped in profile tag, I think. 但是我想这个代码应该包含在profile标签中。 For more details you can see this . 有关详细信息,您可以看到这一点 You can find settings file in $HOME/.m2 directory in linux and same directory in Windows. 您可以在linux中的$HOME/.m2目录和Windows中的相同目录中找到设置文件。

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

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