1

我已将以下配置文件添加到我的 pom.xml 中:

<profiles>
    <profile>
        <id>nexus</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <distributionManagement>
            <repository>
                <id>nexusid1</id>
                   <url>http://</url>
            </repository>
            <snapshotRepository>
                <id>nexusid2</id>
                 <url>http://</url>
            </snapshotRepository>
        </distributionManagement>
    </profile>
</profiles>

我已添加到 settings.xml :

    <server>
<id>nexusid1</id>
<username>username</username>
<password>passwword</password>
    </server>

要将项目添加到我使用的 Nexus 存储库mvn deploy

在这种情况下我需要使用个人资料吗?如果我想部署到nexusid2,这是否意味着我需要向settings.xml 添加一个新的服务器条目,即使nexusid1 和nexusid2 的用户名/密码相同?

4

1 回答 1

2

根据this page,有一个-DaltDeploymentRepository说法是mvn:deploy。但是恕我直言,配置文件将是这里更优雅的解决方案,因为您不需要记住服务器 ID,而是记住配置文件名称。是的,即使用户名和密码相同,您也需要将新服务器添加到 settings.xml。

另外注意:服务器管理的密码加密

于 2012-02-13T15:16:01.017 回答