mvn -f maven-example-jar/pom. This command is used to build a project from a different location. We are providing the pom. xml file location to build the project. It's useful when you have to run a maven build from a script.
Running a Maven build via the command lineYou pass the build life cycle, phase or goal as parameter to this command. Maven reads the pom file and resolves the dependencies of the project. Maven validates if the dependencies are available in a local repository and if they are available these are used.
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.
Can we bind some native OS commands to the maven goals and/or phases?
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