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 Rating

   
 Q31. What are different type of repositories in Maven ?Maven
Ans. Local and Remote.

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

   Like         Discuss         Correct / Improve     maven   maven repository


 Q32. 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


 Q33. 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


 Q34. 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


 Q35. 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


 Q36. 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


 Q37. 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


 Q38. 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


 Q39. What is a transitive dependency ? Can we override Transitive Dependency version and If Yes, how ?Maven
Ans. Transitive dependency is the dependencies not defined directly in the current POM but the POM of the dependent projects.

Yes we can override transitive dependency version by specifying the dependency in the current POM.

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

   Like         Discuss         Correct / Improve     maven   maven dependencies   maven transitive dependency   technical lead   build management


 Q40. 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


Usually asked to experienced developers.
 Q41. What is a cyclic dependency ?Maven
Ans. A has dependency of B, B has dependency of C and C has dependency of A

With Maven 2 , came transitive dependency wherein in above scenario, C will acts as a dependency of A as if this dependency has been defined directly in A but the negative side is that if it leads to cyclic dependency , it creates problems.

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

   Like         Discuss         Correct / Improve     maven   dependencies   cyclic dependencies   transitive dependencies   build management     Asked in 1 Companies        frequent


 Q42. 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


 Q43. 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


 Q44. 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


 Q45. 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


 Q46. 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


 Q47. 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


 Q48. 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


 Q49. 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


 Q50. 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


 Q51. 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


 Q52. Which of the following is dependency exclusion ?

a. A doesn't depend on C and then A marks C as excluded.
b. A Depends on B and B depends on C and then A can mark B as excluded.
c. A and B depends on C and then they can mark C as excluded.
d. A depends upon B and B depends upon C then A marks C as excluded.
Maven
Ans. A depends upon B and B depends upon C then A marks C as excluded.

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

   Like         Discuss         Correct / Improve     maven   dependency exclusion


 Q53. Which of the following is not the dependency scope in Maven ?Maven
a. Compile
b. Runtime
c. Debug
d. Test

Ans.c. Debug

 Q54. Which of following uniquely identify the artifact or dependency in Maven ?Maven
a. Artifact Id
b. Group Id
c. Version
d. All of the above

Ans.d. All of the above

 Q55. Which of following is not type of Maven Repository ?Maven
a. Local
b. Remote
c. Central
d. State

Ans.d. State

previous 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: