Maven Core

Maven Core classes managing the whole build process.

Reference Documentation

Useful entry points

  • Maven component (javadoc), with its DefaultMaven implementation (source), to drive a full Maven execution session
  • ProjectBuilder component (javadoc), with its DefaultProjectBuilder implementation (source), to prepare MavenProject descriptor from POM files,
  • LifecycleExecutor component (javadoc), with its DefaultLifecycleExecutor implementation(source), to plan or execute tasks.
    on plugin goals execution order:
    • in a given phase, goals order is not expected to be guaranteed nor finely tuned: it is just a consequence of the order obtained during effective model building, which combines profile activation+injection and inheritance assembly from parents,
    • known limitations are notably that:

      1. plugin goal execution in a child is usually simply appended (at end): you can't try to insert in the middle of pre-existing inherited executions,

      2. append happens at plugin level first, then goal level, independently from phases. This means for example that adding pluginA:goal2 to pre-existing (pluginA:goal1, pluginB:goal) will lead to (pluginA:goal1, pluginA:goal2, pluginB:goal)

    • see effective POM as shown by help:effective-pom to see the effective plugins then goals order.
  • MavenPluginManager component (javadoc), with its DefaultMavenPluginManager implementation (source),
  • PluginParameterExpressionEvaluator, used to evaluate plugin parameters values during Mojo configuration,
  • ExceptionHandler component (javadoc), with its DefaultExceptionHandler implementation (source), use to transform exception into useful end-user messages.

Toolchains

  • Toolchains descriptor reference,
  • public API for toolchains-aware plugins: ToolchainManager component (javadoc) with its DefaultToolchainManager implementation (source), to get selected Toolchain (javadoc) instance,
  • internal ToolchainManagerPrivate component (javadoc) with its DefaultToolchainManagerPrivate implementation (source), to manage toolchain selection,
  • internal JDK toolchain implementation: JavaToolchain interface (javadoc), with its JavaToolchainImpl implementation (source) and JavaToolchainFactory factory (source).