Interface ToolchainFactory


@Experimental @Consumer public interface ToolchainFactory
Factory interface for creating toolchain instances from configuration models.

This factory is responsible for instantiating concrete toolchain implementations based on toolchain model configurations or default settings.

Since:
4.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a default toolchain instance using system defaults.
    createToolchain(org.apache.maven.api.toolchain.ToolchainModel model)
    Creates a toolchain instance from the provided model configuration.
  • Method Details

    • createToolchain

      @Nonnull Toolchain createToolchain(@Nonnull org.apache.maven.api.toolchain.ToolchainModel model) throws ToolchainFactoryException
      Creates a toolchain instance from the provided model configuration.
      Parameters:
      model - The toolchain configuration model
      Returns:
      A configured toolchain instance
      Throws:
      ToolchainFactoryException - if toolchain creation fails
    • createDefaultToolchain

      @Nonnull Optional<Toolchain> createDefaultToolchain() throws ToolchainFactoryException
      Creates a default toolchain instance using system defaults.
      Returns:
      Optional containing the default toolchain if available
      Throws:
      ToolchainFactoryException - if default toolchain creation fails