Transitive Dependencies
Which term describes the dependencies that are automatically included when you add a Maven dependency whose own pom.xml also lists dependencies?
- Transitive dependencies
- Direct dependencies
- Exclusion dependencies
- Optional dependencies
- Transition dependencies
Dependency Scope Understanding
In Maven, which dependency scope ensures that a library is only available at compile time and not included in the final artifact?
- Provided
- Runtime
- System
- Compile
- Test
Resolving Version Conflicts
When Maven encounters multiple versions of the same dependency due to transitive dependencies, which version does it use by default?
- The version closest to the project in the dependency tree
- The lowest version numerically
- The highest version numerically
- The last declared version in pom.xml
- The earliest published version
Excluding a Transitive Dependency
What is the correct way to exclude a specific transitive dependency in Maven using the pom.xml?
- Add an u003Cexclusionu003E tag inside the u003Cdependencyu003E block
- Set the scope to 'exclude' in the dependency
- Remove it from the u003Cbuildu003E section
- Use u003CdependencyManagementu003E to remove the dependency
- Delete the dependency from the local repository
DependencyManagement Usage
What is the main purpose of the u003CdependencyManagementu003E section in a Maven pom.xml file?
- To centralize and control versions of dependencies for submodules
- To automatically update all dependencies to their latest versions
- To list all direct dependencies of a project
- To define plugin versions only
- To remove unused dependencies from a project
Checking Effective POM
Which Maven command shows the final resolved dependencies and configuration as Maven sees them for your project?
- mvn help:effective-pom
- mvn compile:show
- mvn dependency:list
- mvn resolve:tree
- mvn help:list-dependencies
Optional Dependencies
What happens when you mark a dependency as u003Coptionalu003Etrueu003C/optionalu003E in Maven?
- It will not be transitively included in downstream projects
- Maven will never download the dependency
- It is required for Maven to run tests
- The dependency will be bundled in the final jar
- It disables all scopes for the dependency
Identifying Dependency Conflicts
If you suspect a version conflict between dependencies, which Maven command is most useful to visualize the conflict?
- mvn dependency:tree
- mvn clean install
- mvn test:conflicts
- mvn compile:info
- mvn versions:check
Forcing a Specific Dependency Version
How can you force Maven to use a particular version of a dependency if multiple versions are present in the dependency tree?
- Explicitly declare the preferred version in your project's pom.xml dependencies section
- Delete all other versions from your local repository
- Set the preferred version in u003Cbuildu003E
- Rename the dependency artifact
- Only add the dependency in u003CdependencyManagementu003E
Local Repository Role
What is the main function of Maven's local repository?
- To store downloaded artifacts for offline builds
- To compile Java source files
- To list project contributors
- To manage version control of source code
- To deploy artifacts to remote servers