| 1 | #!/bin/bash |
| 2 | ############################################################################### |
| 3 | # Copyright (c) 2015 Ericsson, EfficiOS Inc. and others |
| 4 | # |
| 5 | # All rights reserved. This program and the accompanying materials |
| 6 | # are made available under the terms of the Eclipse Public License v1.0 |
| 7 | # which accompanies this distribution, and is available at |
| 8 | # http://www.eclipse.org/legal/epl-v10.html |
| 9 | # |
| 10 | # Contributors: |
| 11 | # Marc-André Laperle - Initial version |
| 12 | # Alexandre Montplaisir - Initial version |
| 13 | ############################################################################### |
| 14 | |
| 15 | # Point ourselves to the script's directory (so it can be run "out-of-tree") |
| 16 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 17 | output=`mvn versions:display-plugin-updates -f $DIR/../pom.xml` |
| 18 | |
| 19 | #filter only updates and show unique |
| 20 | summary=`echo "${output}" | grep "\\->" | sort | uniq` |
| 21 | echo -e "Summary:\n${summary}" |
| 22 | |
| 23 | #remove empty lines and count lines |
| 24 | outdatedNb=`echo "${summary}" | sed '/^\s*$/d' | wc -l` |
| 25 | echo Number of outdated plugins: "${outdatedNb}" |
| 26 | exit ${outdatedNb} |