sudo vi dependencygen.sh

 

LIB_PATH=”/…/…/WebContent/WEB-INF/lib”
# Absolute path to this script, e.g. /home/user/bin/foo.sh

SCRIPT=$(readlink -f “$0”)
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname “$SCRIPT”)

cd $LIB_PATH

for word in *.jar
do
echo “<dependency>”
echo “<groupId>com.techie</groupId>”
echo “<artifactId>$word</artifactId>”
echo “<version>1.0.1</version>”
echo “<scope>system</scope>”
echo “<systemPath>\${project.basedir}/lib/$word</systemPath>”
echo “</dependency>”

done

cd $SCRIPTPATH

Run the command

sh dependencygen.sh > dependency.txt

 

Copy paste the content dependency.txt into your pom.xml and run

 

Advertisements