skip to content

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 pageshow

explore

questions

page 2 of 2

What 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 s

Create 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.

open as a page

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 s

Core 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.

open as a page

showing 31–32 of 32