如何让 Nexus 中的快照出现在 m2eclipse 依赖项搜索中?

发布于 2024-08-19 23:10:00 字数 2772 浏览 9 评论 0原文

这个周末我一直在研究 Nexus 指南我已经完成了所有设置,现在我可以将快照发布到本地 Nexus 安装了。

我似乎无法弄清楚如何让 m2eclipse 查看快照并将其作为“添加依赖项”搜索面板中的选项提供。我该怎么做?谢谢!

如果有任何用处,我的settings.xml如下:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository />
    <interactiveMode />
    <usePluginRegistry />
    <offline />
    <pluginGroups />
    <servers>
        <server>
            <id>localSnap</id>
            <username>deployment</username>
            <password>*****</password>
        </server>
    </servers>
    <mirrors>
        <mirror>
            <!--This sends everything else to /public -->
            <id>nexus</id>
            <mirrorOf>*</mirrorOf>
            <url>http://localhost:8080/nexus/content/groups/public</url>
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>nexus</id>
            <!--Enable snapshots for the built in central repo to direct -->
            <!--all requests to nexus via the mirror -->
            <repositories>
                <repository>
                    <id>central</id>
                    <url>http://central</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>central</id>
                    <url>http://central</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <!--make the profile active all the time -->
        <activeProfile>nexus</activeProfile>
    </activeProfiles>

</settings>

I've been working through the Nexus guide this weekend and I've got everything set up, to the point that I can publish a snapshot to my local nexus install.

I can't seem to work out how to get m2eclipse to see the snapshot and offer it as an option in the Add Dependencies search panel. How do I do that? Thanks!

In case it's of any use, my settings.xml is as follows:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository />
    <interactiveMode />
    <usePluginRegistry />
    <offline />
    <pluginGroups />
    <servers>
        <server>
            <id>localSnap</id>
            <username>deployment</username>
            <password>*****</password>
        </server>
    </servers>
    <mirrors>
        <mirror>
            <!--This sends everything else to /public -->
            <id>nexus</id>
            <mirrorOf>*</mirrorOf>
            <url>http://localhost:8080/nexus/content/groups/public</url>
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>nexus</id>
            <!--Enable snapshots for the built in central repo to direct -->
            <!--all requests to nexus via the mirror -->
            <repositories>
                <repository>
                    <id>central</id>
                    <url>http://central</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>central</id>
                    <url>http://central</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <!--make the profile active all the time -->
        <activeProfile>nexus</activeProfile>
    </activeProfiles>

</settings>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云胡 2024-08-26 23:10:00

我现在有了答案。您必须设置 Nexus 才能发布索引。 http://www.sonatype.com/people/2009/09/ nexus-scheduled-tasks ...设置计划任务,为 m2eclipse 等客户端发布索引。但您必须等到 nexus 的计划任务部分出现 WAITING 状态。 eclipse重启后就应该可以工作了。问候,Jakub

顺便说一句:您的代理存储库必须具有“下载远程索引 - true”并且 nexus 必须能够搜索远程索引......但我想您知道这一点

I have the answer now. you have to set up nexus to publish the index. http://www.sonatype.com/people/2009/09/nexus-scheduled-tasks ...Set up the schedule task to publish the index for clients like m2eclipse. But you must wait until WAITING status appears at the scheduled task section in nexus. After eclipse restart it must work. Regards, Jakub

BTW: your proxied repositories must have "Download Remote Indexes - true" and nexus must be able to search through remote indexes... but I supposed you know that

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文