Interview Questions and Answers for 'Maven' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

next 30
 Q11. How does Maven looks for a resource ? Maven
Ans. It refers to the settings.xml to look for the repositories to look for the resource. First It looks into the configured local repository, then it looks into the configured Remote repositories. If the resource is still not found , it looks it within maven repository central i.e repo1.maven.org. If its still not found, it throws the exception saying "Unable to find resource in repository central".

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven repository


 Q12. What is repository central ?Maven
Ans. Its the repository provided by Maven. In case your POM specify the dependencies and its not available in the configured local and the remote repository. It then looks for the resource in Maven Central. Maven provides most of the generic dependency resources at this remote location.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven repository


 Q13. What is Maven's order of inheritance?

a. parent pom -> project pom -> settings -> CLI parameters
b. project pom -> parent pom -> settings -> CLI parameters
c. settings -> parent pom -> project pom -> CLI parameters
d. CLI parameters -> settings -> parent pom -> project pom
Maven
Ans. parent pom -> project pom -> settings -> CLI parameters

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven

Try 1 Question(s) Test


 Q14. What is the best practice configuration usage for files - pom.xml or settings.xml ?Maven
Ans. The best practice guideline between settings.xml and pom.xml is that configurations in settings.xml must be specific to the current user and that pom.xml configurations are specific to the project.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   build technologies   pom.xml   settings.xml   architecture   technical architect   technical lead   build management   build and release

Try 1 Question(s) Test


 Q15. How can I change the default location of the generated jar when I command "mvn package"?Maven
Ans. By default, the location of the generated jar is in ${project.build.directory} or in your target directory. We can change this by configuring the outputDirectory of maven-jar-plugin.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   build technologies   build management   build and release   release management


 Q16. How do I determine which POM contains missing transitive dependency?Maven
Ans. run mvn -X

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   build technologies   pom   build management


 Q17. What would you do if you have to add a jar to the project using Maven ?Maven
Ans. If its already there in Maven local repository, We can add that as a dependency in the project pom file with its Group Id, Artifact Id and version.

We can provide additional attribute SystemPath if its unable to locate the jar in the local repository.

If its not there in the local repository, we can install it first in the local repository and then can add it as dependency.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven dependencies   jar   architecture


 Q18. Have you ever had problem getting your projects in eclipse refreshed after you made changes in the Pom files ?Maven
Ans. Yes, It happens many times but I would usually perform mvn eclipse:eclipse and this would resolve the project refresh problems.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven repository   eclipse     Asked in 1 Companies


 Q19. What is the difference between compile and install ?Maven
Ans. Compile compiles the source code of the project

whereas

Install installs the package into the local repository, for use as a dependency in other projects locally

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   install   build management


 Q20. How to perform a clean install without executing Tests ?Maven
Ans. mvn clean install -Dmaven.test.skip=true

or

mvn install -DskipTests

or


org.apache.maven.plugins
maven-surefire-plugin

true



within parent POM file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven install   unit testing   unit tests


 Q21. How can we see Dependencies for the project and where exactly they are defined ?Maven
Ans. Using

mvn dependency:tree

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven repository   maven dependencies   dependency tree


 Q22. What are the benefits of transitive depency in Maven ?Maven
Ans. Transitive dependencies allows to avoid specifying the libraries that are required by the project which are specified in other dependent projects - Remote or Local.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven repository   dependencies   transitive dependencies   build management


 Q23. What is the difference between Maven, Ant and Jenkins ?Tool
Ans. Maven and Ant are Build Technologies whereas Jenkins is a continuous integration tool.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   ant   jenkins   build technologies


 Q24. How do I determine which POM contains missing transitive dependency?

a. mvn -A
b. mvn -M
c. mvn -R
d. mvn -X
Maven
Ans. mvn -X

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven transitive dependencies


 Q25. What is the sequence in which Maven looks for the resources ?

a. Remote-> Maven Central - > Local
b. Local -> Remote - Maven Central
c. Remote-> Local -> Maven Central
d. Maven Central -> Local -> Remote
Maven
Ans. Local -> Remote - Maven Central

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven


 Q26. POM stands for ...

a. Project Object Model
b. Project Oriented Model
c. Prospective Object Model
d. Prospective Objective Model
Maven
Ans. Project Object Model

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   pom

Try 1 Question(s) Test


 Q27. Which of the following is not type of Maven Repository ?

a. Local
b. Remote
c. Maven Central
d. Maven Local
Maven
Ans. Maven Local

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   repositories


 Q28. What is the default location of local repository ?

a. ~/.m2/repo
b. ~/m2./home/repository
c. ~/m2./repository
d. ~/m2./home/repo
Maven
Ans. ~/m2./repository

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   repositories   local repositories   m2


 Q29. Which of the following is not type of Maven Plugin ?

a. Build
b. Reporting
c. Remote
d. All are valid Maven Plugin types
Maven
Ans. Remote

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven plugins


 Q30. Which of the following is not a dependency scope in Maven ?

a. Compile
b. Test
c. System
d. Export
Maven
Ans. Export

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven dependencies


 Q31. What is a project's fully qualified artifact name?

a. ::
b. :
c. ::
d. :
Maven
Ans. ::

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   artifact


 Q32. Have you heard of Ban Duplicate Classes Maven enforcer plugin ? What is its use ?Maven
Ans. Yes , we have been using this plugin with our projects and its purpose is to warn and stop the Build if there are duplicates of the same package and class are being carried either directly or through transitive dependencies. the duplicate could be coming through different types of dependencies or through different versions of the same dependency. Its purpose is to make sure that there is only one copy thats being used at compile time and runtime and hence shouldnt later result in runtime problems.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   ban duplicate classes enforcer plugin


 Q33. How to tackle duplicate classes in maven build ?Maven
Ans. The simplest way is to ignore them if Maven enforcer plugin is complaining about it but it may lead to runtime problems later.

We can do the dependency:tree to see from where these duplicate ones are coming and hence can exclude the duplicate one.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   ban duplicate classes enforcer plugin


 Q34. What are different dependency scopes in Maven ?Maven
Ans. Compile

This is the default scope. Compile dependencies are available in all classpaths of a project. Moreover, these dependencies are propagated to dependent projects.

Provided

This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime.

Runtime

This scope indicates that the dependency is not required for compilation, but is for execution.

Test

This scope indicates that the dependency is is only available for the test compilation and execution phases. This scope is not transitive.

System

This scope is similar to provided except that you have to provide the JAR which contains it explicitly.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven  maven dependency scopes


 Q35. What are the build lifecycles of Maven ?Maven
Ans. Default , Clean and Site.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven


 Q36. What is a Test Dependency Scope in Maven ?Maven
Ans. This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. This scope is not transitive.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven     Asked in 2 Companies


 Q37. If Project A is calling web service of project B and there are some changes in project B, Will Project A needs to be rebuilt ?Maven
Ans. That depends if the interface for the resource in Project B gets changed. If only the internal implementation is changed, No change is required in Project A. Project A is not even required to be rebuilt.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     project dependencies


 Q38. What is the POM packaging in Maven ?Maven
Ans. pom packaging is simply a specification that states the primary artifact is not a war or jar, but the pom.xml itself.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     pom  pom packaging  maven module


 Q39. Difference between Maven Project and Module ?Maven
Ans. Maven Module has a Parent whereas Project doesnt. when we add the parent section to the pom file, it adds the module section to the parent project pom file. When we execute mvn compile / install, it basically checks that module section of the parent to identify all the modules that needs to be compiled first.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven project vs module  maven project  maven module        frequent


 Q40. How to specify the sequence in which sub modules needs to be built ?Maven
Ans. By specifying the modules in the same sequence in the parent pom.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven  pom file  maven modules


next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: