If you are really aiming at doing continuous delivery (any potential build can be pushed to prod), then SNAPSHOT is not a great way to deal with dependencies since you will not be able to exactly know what you ship. To avoid this, one practice is to use the build number in the artifact version (1.0.0-b1 or 1.0.1). This has of course had the drawback that now you have to update the pom.xml of components using a specific artifact (move from build 1 to 2) but this also gives you greater control on the rate at which you consume libraries.
You may be interested in these articles:
- http://maven.40175.n5.nabble.com/Continuous-Delivery-and-Maven-td3245370.html - http://stackoverflow.com/questions/18456111/what-is-the-maven-way-for-project-versions-when-doing-continuous-delivery

That said, if you add Artifactory to the mix, you can leverage its capabilities of obtaining specific versions of a SNAPSHOT through matrix parameters (https://www.jfrog.com/confluence/display/RTF/Using+Properties+in+Deployment+and+Resolution) quite handy. One example where this comes handy is when you split your build process over multiple jenkins jobs and you want to make sure that you use the same artifact throughout the process and this w/o blocking the whole "pipeline" for the whole duration of the process.

HTH

Pascal
On 12/06/2014 10:46 AM, Hohl, Gerrit wrote:
Hello everyone, :)

I have a question which is not about a specific problem with Maven, but
more a general question.

I hope it is okay to ask this question here.

We use Maven and Jenkins for about 1.5 years now, I guess. Until now the
Maven projects have been very simple and - let's say - very monolithic.

But recently we identify more and more internal libraries in our
products. Of course we don't want to share this libraries by
copy-n-paste between the products - especially as we have Maven.

So we started to read books, tutorials on the Internet and so on. But
most of them only deal with simple projects. They don't cover e.g.
versioning the build process (especially if your build process consists
of more than just one step). They also don't cover the problems of
developing the libraries while your developing the products which depend
on them. Especially at the beginning your libraries will go through a
lot of changes. A few name snapshots as a solution, but don't explain
how you can work using them, how you can use them in your pom.xml and
how you deal with them if you finally switch your product and/or your
library from the snapshot state to the release state. A few also say
that you shouldn't use snapshots at all because it will result in many
problems (e.g. having -SNAPSHOT entries in your pom.xml). Nightly builds
or build triggered by the SCM are also an issue here.

Does someone know a good book or tutorial which handles all of these
issues around Maven and CI/CD in more depth?

Regards,

Gerrit




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to