maven - 在命令行上添加一个 maven(发行版)存储库

标签 maven command-line continuous-integration repository

我认为这应该是可能的,但我没有找到任何与之相关的东西,因为我发现的所有东西都与依赖存储库有关。

我想做的是定义 maven(例如部署或发布插件)推送 Artifact 的存储库。如何在命令行上定义它?我假设它是 -Dsomething
更新:当我仔细阅读 Jenkins 错误输出时,它提示使用:-DaltDeploymentRepository=id::layout::url
使用它的格式是什么?什么是布局参数?

最佳答案

最简单的就是阅读documentation about the maven-deploy-plugin其中描述了格式:

mvn -DaltDeploymentRepository=repositoryId::default::http://WhatEverURL

在 distributionManagement 中,您通常会给出以下内容:
 <distributionManagement>
    <repository>
      <id>internal.repo</id>
      <name>MyCo Internal Repository</name>
      <url>Host to Company Repository</url>
    </repository>
  </distributionManagement>

如果您想在这种情况下使用不同的 URL,您需要提供:
mvn -DaltDeploymentRepository=internal.repo::default::http://WhatEverURL

在这种情况下,默认值是 maven repository layout 的默认值。 .

关于maven - 在命令行上添加一个 maven(发行版)存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12435283/

相关文章:

java - Spring MVC与Hibernate持久层集成测试

Maven war 就地: clean classes and lib folder

continuous-integration - Psake 是做什么用的?

java - 如何在VS code上创建maven项目?

mysql - 如何使用 mysql cmdline 获取受影响记录的数量,仅此而已?

linux - 运行 "$ ls -la | script.sh"之类的 shell 脚本有什么用?

macos - MacOS 10.12.6安装Perl模块WWW:Curl::Easy错误在Availability.h中

php - Github Actions CI/CD 工作流中的 .env 文件 : how to provide these into the workflow

azure - CI/CD/重建 Azure APIM 开发人员门户内容

java - 添加 jSTL 作为 Maven 依赖