【问题标题】:mvn deploy specific urlmvn 部署特定网址
【发布时间】:2017-12-25 19:38:26
【问题描述】:

尝试将工件部署到 nexus,但它必须位于忽略 groupId 的特定位置。有没有办法做到这一点?

<groupId>com.company.team</groupId>
<artifactId>project</artifactId>
<version>0.0.3-SNAPSHOT</version>

我们内部存储库的 url 是:

http://repo.com/teamRepo/somedir/artifact/version/

但 Maven 部署(如预期)上传到:

http://repo.com/teamRepo/com/company/team/artifact/version/

【问题讨论】:

  • 你的distributionManagement配置正确了吗?
  • 您使用的是 Nexus/Artifactory 吗?为什么要消除groupId?
  • 我们正在使用 nexus,很遗憾,这不是我的决定,测试团队希望在某个位置有一个 tar

标签: maven nexus


【解决方案1】:

通过使用 mvn deploy:deploy-file 命令能够做到这一点:

 mvn deploy:deploy-file -Durl=https://repo.com/teamRepo -DgroupId=team -DartifactId=artifact -Dversion=0.0.3 -Dpackaging=tar.gz -DskipTests -Dmaven.install.skip=true -DrepositoryId=repoId -Dfile=target/artifact.tar.gz

使用 -DrepositoryId 是为了允许使用根据此答案存储的凭据Maven: Trying to Deploy with credentials in settings.xml file

【讨论】:

    猜你喜欢
    • 2012-01-15
    • 2016-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-23
    • 2018-11-02
    • 1970-01-01
    相关资源
    最近更新 更多