Sometimes your projects requires dependencies like A:v1, B:v2…. Z:v8 which could be affected by a later release of your product, let’s say that you are going to release the v2.0.0 of your product that requires greater versions of those dependencies and the following question appears: is this going to affect any customer that depends on those third party dependencies? The answer: Yup, that’s very likely!
For products that offers frameworks like TestingSoft TAF, it’s very common to have some problems when a third party dependency is updated, since you cannot really be sure of what could be deprecated or changed and you don’t have time to read a POM.xml to check what version is needed (seriously, reading XML is not that hard, but it’s not quite “friendly” for some people), you need a good alternative to check these versions and then decide if you really need to step up into the product or begin a research and determine how many changes you need in your code (in a test environment) in order to implement a new version.
The following code should be used as a post step of your CI handler (in my case Jenkins), the script will generate an HTML file which can be saved or published.
DEPSLINES=`mvn dependency:list | sed -n "/following/,/---/p" | sed -e 's/\[INFO\]//g' | sed -e 's/\s//g' | tail -n +2 | head -n -2`
for x in $DEPSLINES
CELL1=`echo $x | grep -oE '^([a-zA-Z0-9\.-])+:([a-zA-Z0-9\.-])+'`
CELL2=`echo $x | grep -oE ':([0-9\.]).*$' | sed -e 's/://' | sed -e 's/:.*$//'`
cat << EOF > dependencyVersionControl.html
<title>Version Control - Dependencies</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; maximum-scale=1.5; minimum-scale=1.5;" />
And here is an example of how the result will look.
Latest posts by Carlos Alberto Umanzor Arguedas (see all)