Skip to content

Instantly share code, notes, and snippets.

@shsteimer
Last active March 30, 2023 01:09
Show Gist options
  • Save shsteimer/a4a4b1c865830fdd5e41872cd2767106 to your computer and use it in GitHub Desktop.
Save shsteimer/a4a4b1c865830fdd5e41872cd2767106 to your computer and use it in GitHub Desktop.
A bash script to run mvn clean on all projects in a directory
#!/bin/bash
find /Users/ssteimer/dev/workspaces -type f -name "pom.xml" | while read line;
do
echo found file at $line
len=${#line}
pomLen=$((len-8))
pomDir=${line:0:pomLen}
cd $pomDir
mvn clean
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment