Java - Interview Questions and Answers for 'Dependencies' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2137 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Dependencies' - 9 question(s) found - Order By Newest

 Q1. What is a transitive dependency ? Can we override Transitive Dependency version and If Yes, how ?Maven
Admin
info@buggybread.com
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


Usually asked to experienced developers.
 Q2. What is a cyclic dependency ?Maven
Admin
info@buggybread.com
Ans. A has dependency of B, B has dependency of C and C has dependency of A,architecture,technical lead

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     Synechron        frequent


 Q3. What would you do if you have to add a jar to the project using Maven ?Maven
admin
info@buggybread.com
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


 Q4. How can we see Dependencies for the project and where exactly they are defined ?Maven
Admin
info@buggybread.com
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


 Q5. What are the benefits of transitive depency in Maven ?Maven
Admin
info@buggybread.com
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


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

a. mvn -A
b. mvn -M
c. mvn -R
d. mvn -X
Maven
Anonymous
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


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

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

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

   Like      Discuss      Correct / Improve     maven   maven dependencies


 Q8. 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 ?Maven2016-11-14 11:28:04

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


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

Ans.c. Debug



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

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:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: