07 November 2020

#Maven

#Maven

Key Concepts


Topic Sub-Topics Basic Intermediate Advanced Expert
Introduction What is Maven, Build Lifecycle, Maven vs Ant/Gradle
Installation & Setup Install Maven, Configure PATH, Settings.xml
Maven Project Basics POM.xml structure, GroupId, ArtifactId, Version (GAV)
Build Lifecycle Clean, Default, Site lifecycle phases
Dependencies Dependency scope, Transitive dependencies, Dependency management
Repositories Local repo, Remote repo, Central repo, Mirror settings
Plugins & Goals Maven Compiler plugin, Surefire plugin, Assembly plugin
Build Profiles Profile activation, Environment-based builds, Conditional builds
Multi-Module Projects Parent POM, Module inheritance, Aggregation
Maven Properties User-defined properties, Built-in properties, Property interpolation
Maven Archetypes Creating projects from archetypes, Custom archetypes
Maven Goals & Phases Custom goals, Binding plugins to phases
Testing with Maven JUnit/TestNG integration, Surefire plugin, Failsafe plugin
Maven & CI/CD Integrating with Jenkins, GitHub Actions, GitLab CI
Advanced Dependency Mgmt Dependency mediation, Exclusions, Dependency convergence
Maven Wrapper mvnw usage, Wrapper configuration for projects
Performance Optimization Parallel builds, Dependency caching, Offline builds
Custom Plugins Writing Maven plugins, Extending lifecycle
Maven in Enterprise Corporate repositories (Nexus/Artifactory), Governance
Maven Best Practices Versioning strategy, Dependency minimization, Reproducible builds
Troubleshooting & Debugging Maven debug mode (-X), Effective POM, Dependency tree (mvn dependency:tree)

Interview question

Basic

  1. What is Maven and why is it used?
  2. Difference between Maven and Ant?
  3. What is the role of the pom.xml file?
  4. What is a Maven build lifecycle?
  5. What are the default build lifecycles in Maven?
  6. What is the difference between install and deploy phases?
  7. How do you run a Maven build?
  8. What is the difference between mvn clean and mvn package?
  9. How do you check Maven version?
  10. What is the default directory structure of a Maven project?
  11. What are Maven goals?
  12. What is the difference between validate and verify phases?
  13. What is the role of the target folder?
  14. How do you create a Maven project from command line?
  15. What is the use of mvn archetype:generate?
  16. How do you define project dependencies in Maven?
  17. What is the Maven repository?
  18. Difference between local, central, and remote repositories?
  19. What is the role of .m2 folder?
  20. What is a Maven snapshot?
  21. Difference between SNAPSHOT and release version?
  22. How do you skip tests in Maven build?
  23. What is the purpose of Maven compiler plugin?
  24. What is the role of settings.xml file in Maven?
  25. How do you run only specific tests in Maven?

Intermediate

  1. What is the difference between mvn install and mvn deploy?
  2. Explain Maven dependency management.
  3. What are transitive dependencies in Maven?
  4. How do you exclude a transitive dependency?
  5. What are dependency scopes in Maven?
  6. Difference between compile, provided, runtime, test, and system scopes?
  7. How do you resolve version conflicts in dependencies?
  8. What is a Maven archetype?
  9. How do you configure a plugin in Maven?
  10. What is the use of Maven Surefire plugin?
  11. How do you build a JAR file using Maven?
  12. How do you build a WAR file using Maven?
  13. What is the Maven Assembly plugin?
  14. What is the Maven Shade plugin?
  15. Difference between Maven Assembly and Shade plugin?
  16. What is the Maven Dependency plugin?
  17. What are profiles in Maven?
  18. How do you activate Maven profiles?
  19. How do you configure different environments in Maven?
  20. How do you skip a plugin execution in Maven?
  21. What is Maven release plugin?
  22. How do you handle multi-module projects in Maven?
  23. What is the parent POM in Maven?
  24. What is inheritance in Maven POMs?
  25. Difference between dependency management and dependencies section?

Advanced

  1. How do you create custom Maven plugins?
  2. Explain the internal architecture of Maven.
  3. How does Maven resolve dependencies internally?
  4. What is a BOM (Bill of Materials) in Maven?
  5. How do you use BOM for dependency management?
  6. What is the difference between import scope and compile scope?
  7. How do you enforce dependency convergence?
  8. Explain how Maven integrates with CI/CD pipelines.
  9. How do you integrate Maven with Jenkins?
  10. How do you integrate Maven with GitHub Actions or GitLab CI?
  11. How do you deploy Maven artifacts to Nexus or Artifactory?
  12. What is the difference between mvn site and mvn install?
  13. What is the use of Maven Site plugin?
  14. How do you generate project reports in Maven?
  15. How do you configure code coverage tools (JaCoCo) with Maven?
  16. How do you configure static analysis tools (Checkstyle, PMD, SpotBugs) with Maven?
  17. What are build extensions in Maven?
  18. How do you implement reproducible builds in Maven?
  19. How do you configure incremental builds in Maven?
  20. What is the difference between Maven wrapper (mvnw) and Maven installation?
  21. How do you handle circular dependencies in Maven?
  22. How do you override plugin versions in Maven?
  23. Explain dependency mediation in Maven.
  24. How do you configure parallel builds in Maven?
  25. What are some best practices in managing dependencies in Maven?

Expert

  1. How does Maven differ from Gradle?
  2. Explain the internals of the Maven build lifecycle phases.
  3. How do you implement enterprise-level dependency management in Maven?
  4. Explain Maven's interaction with Ivy and Ant.
  5. How do you design a corporate Maven repository strategy?
  6. How do you secure Maven repositories?
  7. What are repository mirrors in Maven?
  8. How do you configure mirrors in settings.xml?
  9. How do you configure authentication for private Maven repositories?
  10. What are wagon providers in Maven?
  11. How do you configure HTTPS for Maven repositories?
  12. How do you use GPG signing with Maven?
  13. Explain the lifecycle of Maven plugin execution.
  14. How do you debug Maven builds?
  15. How do you use Maven with Dockerized builds?
  16. How do you configure caching strategies for Maven builds in CI/CD?
  17. Explain Maven Reactor and its role in multi-module builds.
  18. How do you configure dependency substitution in Maven?
  19. How do you use Maven Toolchains?
  20. Explain polyglot Maven (YAML, Groovy POMs).
  21. How do you optimize Maven for large-scale enterprise builds?
  22. How does Maven interact with containerized microservices builds?
  23. How do you automate artifact promotion from snapshot to release in Maven?
  24. How do you implement versioning strategies with Maven in monorepos?
  25. Future trends: What is the role of Maven in the era of Gradle and Bazel?

Related Topics