[Hawkular-dev] Maven, Continuous and Reproducible

Peter Palaga ppalaga at redhat.com
Wed Aug 19 15:36:23 EDT 2015


Hi *,

I think I found a way how to make our process more continuous, while 
staying with stock Maven and Components in separate git repositories.

The core of the idea is that we actually do not need to release the 
components because they are not our deliverables (yes, except for 
Metrics). If we were able to declare the dependencies using git 
revisions and build them on the fly, we could get rid of both SNAPSHOTS 
and releases.

I have written srcdeps-maven-plugin [1] today that does exactly that:
  * It collects dependencies with versions matching
    {whatever}-SRC-{git-commit-hash}
  * It checks out {git-commit-hash} of their sources to
    ~/.m2/dependency-sources
  * It changes the version in the sources to
    {whatever}-SRC-{git-commit-hash}
  * Builds the artifacts and installs them to the local repository
  * All the above happens before the dependency resolution starts
    so it is fully transparent for the rest of Maven.
  * The -SRC- dependencies are build only if they are not found in local
    repository - so they prolong the build only when upgrading.

How to try it out:

#Make sure that you have maven 3.2.5 or newer:
mvn -version

# build the plugin
cd ~/git
git checkout https://github.com/ppalaga/srcdeps-maven-plugin.git
cd srcdeps-maven-plugin
mvn clean install

# build hawkular with the plugin
cd ../hawkular
git remote add ppalaga https://github.com/ppalaga/hawkular.git
git fetch ppalaga
git checkout -b 150819-srcdeps
mvn clean install ...

[1] https://github.com/ppalaga/srcdeps-maven-plugin


More information about the hawkular-dev mailing list