12.What would the command mvn clean do ?
This command removes the target directory with all the build data before starting the build process.
13.What are the phases of a Maven Build Lifecycle?
Following are the phases −
validate − validate the project is correct and all necessary information is available.
compile − compile the source code of the project.
test − test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
package − take the compiled code and package it in its distributable format, such as a JAR.
integration-test − process and deploy the package if necessary into an environment where integration tests can be run.
verify − run any checks to verify the package is valid and meets quality criteria.
install − install the package into the local repository, for use as a dependency in other projects locally.
deploy − done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
14.What is a goal in Maven terminology?
A goal represents a specific task which contributes to the building and managing of a project. It may be bound to zero or more build phases. A goal not bound to any build phase could be executed outside of the build lifecycle by direct invocation.
15.What would this command do mvn clean dependency:copy-dependencies package?
This command will clean the project, copy the dependencies and package the project (executing all phases up to package).
16.What phases does a Clean Lifecycle consist?
The clean lifecycle consists of the following phases −
17.What phases does a Site Lifecycle consist?
The phases in Site Lifecycle are −
18.What is Build Profile?
A Build profile is a set of configuration values which can be used to set or override default values of Maven build. Using a build profile, you can customize build for different environments such as Production v/s Development environments.
19.What are different types of Build Profiles?
Build profiles are of three types −
Per Project − Defined in the project POM file, pom.xml.
Per User − Defined in Maven settings xml file (%USER_HOME%/.m2/settings.xml).
Global − Defined in Maven global settings xml file (%M2_HOME%/conf/settings.xml)
20.How can you activate profiles?
A Maven Build Profile can be activated in various ways −
Explicitly using command console input.
Through maven settings.
Based on environment variables (User/System variables).
OS Settings (for example, Windows family).