Note that there are some explanatory texts on larger screens.

plurals
  1. POAlgorithm for troubleshooting "Maven doesn't work for me" problems
    text
    copied!<p>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.</p> <p>More formally - <strong>in ideal world</strong> 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 <a href="http://en.wikipedia.org/wiki/Pure_function" rel="nofollow noreferrer">pure function</a> 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".</p> <p><strong>In real world</strong> either "an environment" changes over time or varies between developer machines, possibly because it includes some dependencies one neither expects nor realizes.</p> <p><strong>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.</strong> 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".</p> <p>These are some steps I usually use:</p> <ol> <li>compare effective POMs obtained via <code>mvn help:effective-pom</code></li> <li>compare mvn executable versions + other involved tools (for example jdk)</li> <li>compare environment settings (obtained under Windows using command line's <code>set</code> command)</li> <li>compare <code>settings.xml</code> files from user's home directories</li> <li>compare classpaths generated using <code>mvn dependency:build-classpath</code></li> <li>delete repository or even both repositories</li> </ol> <p><strong>Any ideas what else can give valuable informations? Maybe there is a better way I am simply missing...</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload