简体   繁体   English

Maven和JFROG工件

[英]Maven and JFROG artifactory

I'm using 'mvn install' command, It is pushing artifacts to JFROG under libs-release-local with groupId, artifactID and Version Number. 我正在使用“ mvn install”命令,它将工件通过具有groupId,artifactID和Version Number的libs-release-local推送到JFROG。

What my question is: artifact version is 1.2.1, It is replacing a new artifact and deleting old artifact. 我的问题是:工件版本为1.2.1,它正在替换新工件并删除旧工件。 Can I push artifact under build_Number? 我可以将工件推送到build_Number下吗?

like Ex in Jfrog target repo: libs-release-local/groupIdname/artifactIdname/buildNumber/version(artifact)? 像Jfrog目标回购中的Ex:libs-release-local / groupIdname / artifactIdname / buildNumber / version(artifact)?

Output should like this: If build number is 1 and verion is 1.2.1. 输出应如下所示:如果内部版本号为1,版本为1.2.1。

libs-release-local groupIdname artifactIdname 1 1.2.1 .jar libs-release-local groupIdname artifactIdname 1 1.2.1 .jar

As you implied, "Release" artifacts should be considered immutable in binary repositories, and never get overwritten. 正如您所暗示的,“发布”工件在二进制存储库中应该被认为是不可变的,并且永远不会被覆盖。 What you are describing seems to fit the snapshot artifact model precisely, so you should probably avoid reinventing the wheel here. 您所描述的内容似乎恰好适合快照工件模型 ,因此您可能应该避免在这里重新发明轮子。

Furthermore, Maven has very little flexibility when it comes to the repository layout, so you cannot violate the standard Maven repository layout like that. 而且,Maven在存储库布局方面几乎没有灵活性,因此您不能违反标准的Maven存储库布局。

What you should do is implement snapshot versioning. 您应该执行的是快照版本控制。 In fact, the SNAPSHOT versioning model already contains the build number and a timestamp representing the time of the deployment as part of the artifact deployment path, making every deployment (ie build) unique. 实际上,SNAPSHOT版本控制模型已经包含内部版本号和表示部署时间的时间戳(作为工件部署路径的一部分),从而使每个部署(即内部版本)都是唯一的。 The end result is that every build gets deployed to a unique path and your artifacts are not overwritten during the development phase. 最终结果是每个构建都被部署到唯一的路径,并且在开发阶段不会覆盖您的工件。 When you are ready to transition from the development phase into a the release phase (ie the finalized artifact version), you either promote an existing snapshot version (promoting can sometimes mean changing the version from snapshot to release) or initiate a unique release build that represents the final product, which should never be overwritten. 当您准备从开发阶段过渡到发布阶段(即最终的工件版本)时,您可以升级现有的快照版本(升级有时可能意味着将版本从快照更改为发行版)或启动一个唯一的发行版本代表最终产品,永远不应被覆盖。

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

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