What are different dependency scopes in Maven ?
Javasearch.buggybread.com
Share

Search Interview Questions


 2796 questions in repository.
 There are more than 200 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

   



Java - Interview Questions and Answers

 Q1. What are different dependency scopes in Maven ?Maven2016-09-14 14:12:00

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


Related Questions

  What is a transitive dependency ? Can we override Transitive Dependency version and If Yes, how ?
 How do you resolve Maven Dependencies issue while upgrading dependencies versions ?
  What would you do if you have to add a jar to the project using Maven ?
  How can we see Dependencies for the project and where exactly they are defined ?
  Which of the following is not a dependency scope in Maven ?




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: