What are different dependency scopes in Maven ?
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

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


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 ?



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: