What is the command for finding all subdirectories which contain pom.xml file and then execute:
mvn clean
operation in that subdirectory?
I have workspaces that contain multiple maven projects and I want to clean all of them.
Thus, when mvn clean command executes, Maven deletes the build directory. We can customize this behavior by mentioning goals in any of the above phases of clean life cycle.
mvn clean: Cleans the project and removes all files generated by the previous build. mvn compile: Compiles source code of the project. mvn test-compile: Compiles the test source code. mvn test: Runs tests for the project. mvn package: Creates JAR or WAR file for the project to convert it into a distributable format.
Something like this should probably work:
find . -name "pom.xml" -exec mvn clean -f '{}' ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With