简体   繁体   English

如何测试 maven 部署?

[英]How to test maven deploy?

I work on a maven project but don't have the rights to deploy in the our company nexus (this is done by the CI tool).我在 maven 项目上工作,但无权在我们公司的 nexus 中进行部署(这是由 CI 工具完成的)。 However, while configuring deployment, I would like to test what is actually deployed by "mvn clean deploy".但是,在配置部署时,我想测试“mvn clean deploy”实际部署的内容。

Q: Is there a way to run deploy but don't send anything to the nexus repo?问:有没有办法运行 deploy 但不向 nexus repo 发送任何内容?

I would expect 1 of 2 options:我希望有 2 个选项中的 1 个:

  • there is some kind of dry-run option in deploy for that purpose为此目的,部署中有某种试运行选项
  • there is an option to redirect deployment to some local folder that acts as nexus repo (and thus can see what would have been deployed)有一个选项可以将部署重定向到某个充当 nexus repo 的本地文件夹(因此可以看到将部署的内容)

Note: my project is multi-modules.注意:我的项目是多模块的。

I guess you could just overwrite the <distributionManagement> with a local folder:我想你可以用本地文件夹覆盖<distributionManagement>

<distributionManagement>
  <repository>
    <id>local-release</id>
    <url>file:../local_repo/release</url>
  </repository>
  <snapshotRepository>
    <id>local-snapshot</id>
    <url>file:../local_repo/snapshot</url>
  </snapshotRepository>
</distributionManagement>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM