#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo "Copy these to pom.xml" echo "" for dependency in $(mvn -f "$DIR/fetch_sdk_pom.xml" clean process-sources dependency:tree|grep -E ':(test|compile)$' | grep -o '[[:lower:]].*'|sort); do readarray -d : -t components <<< "$dependency" scope_without_newline="$(echo "${components[4]}"|tr -d '\n')" cat << EOF ${components[0]} ${components[1]} ${components[3]} EOF if [[ "${components[2]}" != "jar" ]]; then echo " ${components[2]}" fi if [[ "${scope_without_newline}" != "compile" ]]; then echo " ${scope_without_newline}" fi cat << EOF EOF done