简体   繁体   中英

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.

What my question is: artifact version is 1.2.1, It is replacing a new artifact and deleting old artifact. Can I push artifact under build_Number?

like Ex in Jfrog target repo: libs-release-local/groupIdname/artifactIdname/buildNumber/version(artifact)?

Output should like this: If build number is 1 and verion is 1.2.1.

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.

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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