Imagine you need a bugfix in a hurry but the internet goes down for a certain amount of time. We can handle this - thanks to a special maven profile called "local".
Usually, during the process of release we need to create a tag, push this tag to a remote hg repo and deploy all the artifacts (jars) to our online maven repository (reserved for our customers).
This process requires intensive use of Internet connectivity - so without the Internet the process will not work.But as everything may fail some day we might be in a situation where we can not use this classical process. To be able to release under these conditions there are 2 main goals to be achieved :
- prevent the release process from pushing to our remote source code repository
- prevent the release proces from deploying the artifacts to the remote maven repo
Simply add to the pom:
<plugin> <artifactId>maven-release-plugin</artifactId> <configuration> <pushChanges>false</pushChanges> <localCheckout>true</localCheckout> </configuration> </plugin>
This works because we use hg rather than SVN.
(Interestingly, this is - in our experience - the ONLY advantage of git/hg over SVN. Forget all the marketing about merging being easier with git or hg. The hard part about merging is the conflicts, and you still have those without SVN.)
That's even simpler:
<plugin> <artifactId>maven-deploy-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin>
Last step: getting the release to you. We'll send it on a USB stick, via UPS!