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. |
|
| ||||
Maven - Interview Questions and Answers for 'Maven dependency' - 2 question(s) found - Order By Newest | ||||
| ||||
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 ? | ||||
| ||||
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 ? | ||||