How do you resolve Maven Dependencies issue while upgrading dependencies versions ?
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. How do you resolve Maven Dependencies issue while upgrading dependencies versions ?Maven
Ans. Step 1 - Upgrade the required dependency , perform build and check build errors

Step 2.1 - If the error is of missing transitive dependency ( which is rare and means that the previous version has a dependency which is missing in the later version ), I would look for the dependency in google and hence will include it as direct dependency in Pom file.

Step 2.2. If the error is for Duplicate dependencies , and the choice is between transitive and direct dependency, I usually remove the direct dependency.

Step 2.3 - If the error is for Duplicate dependencies , and both are transitive dependencies. I first make a choice ( usually later version ) and then ignore the previous version dependency.

Step 2.4 - If the error is for Duplicate dependencies , and there are more than 2 duplicates, I usually ignore it by specifying within maven-enforcer-plugin config.

Step 3 - Perform a Clean Build.

Step 4 - Check Maven Dependency Tree to make sure that Duplicates have been removed or dependency is there in case of missing dependency.

Step 5 - Perform tests and make sure that there are no runtime problems.

Step 6 - If there are runtime problems ( which very likely occurs if you have different version dependencies , very likely by doing 2.4 , you will have to remove step 2.4 and alternately perform 2.2 or 2.3 )

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

   Like         Discuss         Correct / Improve     maven  maven dependency  transitive dependency


Related Questions

  What is a transitive dependency ? Can we override Transitive Dependency version and If Yes, how ?
  What is a cyclic dependency ?
  Which of the following is dependency exclusion ?
  Which of the following is not a build tool or plugin ?

a. Maven
b. Ant
c. Gradle
d. svn
  What is Maven's order of inheritance?
  What is a Mojo?
  Where do we configure repositories in Maven ?
  What are different type of repositories in Maven ?
  How does Maven looks for a resource ?



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: