One of the most common and annoying problems I encounter with Maven is the building process failing/passing depending on who, when and on which machine is executing the process.
More formally - in ideal world I would expect the build process to be repeatable. As a programmer I would say that I expect the build process to be like a pure function of source code and resources being build input and "an environment" - I would expect it to return the same result any time and anywhere I "evaluate" it using "fixed environment" and I expect (rather wish) that everyone in the team has the same "fixed environment".
In real world either "an environment" changes over time or varies between developer machines, possibly because it includes some dependencies one neither expects nor realizes.
What I am trying to achieve asking this question is finding/defining an algorithm/procedure or check list for troubleshooting not repeatable Maven build processes. Let assume we have two separate machines A and B with the same OS and that we are building exactly the same version of our application on them, but they give different results (for example one is successful and one fails). Where/how one should look for differences between these two "environments".
These are some steps I usually use:
mvn help:effective-pom
set
command)settings.xml
files from user's home directoriesmvn dependency:build-classpath
Any ideas what else can give valuable informations? Maybe there is a better way I am simply missing...
Let's make toast American style: you burn, I'll scrape. --W. Edwards Deming.
Instead of looking for an algorithm to troubleshoot your non repeatable builds, fix the root cause, make them repeatable by following good practices (Maven builds are 100% repeatable if you use it right):
~/.m2/settings.xml
I've used Maven in organizations with hundreds of developers without experiencing the problems you're describing. Actually, and I'm sorry to say that, the problems you are facing are not Maven's fault, they're just the result of poor development practices (I don't mean to be rude but that's true).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With