Plugins & Goals
The plugin subsystem end to end: how plugins are resolved, configured, bound to phases, and written from scratch. Interviewers dig here because in Maven everything that actually happens is a plugin goal.
on this pageshowhide
explore
- Plugin Model & Mojos5 questions
- Configuration & Executions5 questions
- Core Build Plugins6 questions
- Compiler Configuration6 questions
- Writing a Plugin (Mojo)5 questions
- Build Extensions5 questions
questions
page 2 of 2What does it take to write your own Maven plugin, and what are the key annotations and packaging involved?
level: seniorimportance: nice to knowfreq 25%
basics
~10 sCreate a project with <packaging>maven-plugin</packaging>, depend on maven-plugin-api, and write a class extending AbstractMojo. Annotate it with @Mojo(name="...") and @Parameter fields, implement execute(), and the maven-plugin-plugin generates the descriptor.
Compare core extensions (.mvn/extensions.xml) versus build extensions (<build><extensions>): when does each load, and why does it matter?
level: principalimportance: nice to knowfreq 18%
basics
~10 sCore extensions in .mvn/extensions.xml load before the POM is read, so they can change project loading itself. Build extensions in <build><extensions> load later, while building an already-parsed project, so they're limited to build-time machinery.
showing 31–32 of 32