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にデプロイする場合、これは、nexusid1とnexusid2のユーザー名/パスワードが同じであっても、settings.xmlに新しいサーバーエントリを追加する必要があることを意味しますか?

4

1 に答える 1

2

このページによると、の-DaltDeploymentRepository引数がありますmvn:deploy。しかし、imho、ここではプロファイルがより洗練されたソリューションになるでしょう。サーバーIDを覚えておく必要はなく、プロファイル名を覚えておく必要があるからです。はい、ユーザー名とパスワードが同じであっても、settings.xmlに新しいサーバーを追加する必要があります。

その他の注意:サーバー管理のためのパスワード暗号化

于 2012-02-13T15:16:01.017 に答える