Maven Interview Questions
Maven Interview Questions:
1.What are the scopes available in maven ?
compile – default
provided
2.What are the different phases of Maven life cycle ?
Validate
compile
test
package
verify
install
deploy
3.What is the difference between install and package ?
mvn package just creates the package like jar/ear/war/zip in your target folder.
Syntax: mvn clean package
mvn install creates the package like jar/ear/war/zip in your target folder and moves to your local repository
Syntax: mvn clean install
mvn install / mvn package itself is enough to perform this, but it is always recommended to perform clean before that to make sure existing things are cleared from target.
install command helps us if we have dependent project which needs this particular ear/jar created, then it takes from the local repository.
4. How do you perform maven build with the jars available in local ?
It’s just a 3 step process, full details are here.