Skip to content

Instantly share code, notes, and snippets.

@mkutz
Created April 18, 2018 08:45
Show Gist options
  • Save mkutz/7a64dac0c34b4286eb29acf73ec96b43 to your computer and use it in GitHub Desktop.
Save mkutz/7a64dac0c34b4286eb29acf73ec96b43 to your computer and use it in GitHub Desktop.
Bash script to execute mvn clean for all sub directories containing a pom.xml
#!/usr/bin/env bash
#
# executes mvn clean for all sub directories containing a pom.xml
#
find . -name "pom.xml" -exec mvn clean -f '{}' \;
@kh0ma
Copy link

kh0ma commented Apr 13, 2021

Nice command. But also it would be great to perform cleaning in parallel. Multimodule projects could be excluded from further cleaning.

@mkutz
Copy link
Author

mkutz commented Apr 14, 2021

Thanks.
Both good ideas.

@lppsuixn
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment