Package org.apache.maven.toolchain
Class ToolchainManagerFactory.DefaultToolchainManagerV4
java.lang.Object
org.apache.maven.toolchain.ToolchainManagerFactory.DefaultToolchainManagerV4
- All Implemented Interfaces:
Service
,ToolchainManager
- Enclosing class:
- ToolchainManagerFactory
public class ToolchainManagerFactory.DefaultToolchainManagerV4
extends Object
implements ToolchainManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetToolchainFromBuildContext
(Session session, String type) Retrieves the currently active toolchain from the build context.getToolchains
(Session session, String type) Retrieves all toolchains of the specified type without additional requirements.Retrieves toolchains matching the specified type and requirements.void
storeToolchainToBuildContext
(Session session, Toolchain toolchain) Stores a toolchain in the build context for later retrieval.
-
Constructor Details
-
DefaultToolchainManagerV4
public DefaultToolchainManagerV4()
-
-
Method Details
-
getToolchains
@Nonnull public List<Toolchain> getToolchains(@Nonnull Session session, @Nonnull String type, @Nullable Map<String, String> requirements) throws ToolchainManagerExceptionDescription copied from interface:ToolchainManager
Retrieves toolchains matching the specified type and requirements.- Specified by:
getToolchains
in interfaceToolchainManager
- Parameters:
session
- The Maven session contexttype
- The type of toolchain (e.g., "jdk", "compiler")requirements
- Key-value pairs specifying toolchain requirements (e.g., "version": "11")- Returns:
- List of matching toolchains, never null
- Throws:
ToolchainManagerException
- if toolchain retrieval fails
-
getToolchainFromBuildContext
@Nonnull public Optional<Toolchain> getToolchainFromBuildContext(@Nonnull Session session, @Nonnull String type) throws ToolchainManagerException Description copied from interface:ToolchainManager
Retrieves the currently active toolchain from the build context.- Specified by:
getToolchainFromBuildContext
in interfaceToolchainManager
- Parameters:
session
- The Maven session contexttype
- The type of toolchain to retrieve- Returns:
- Optional containing the toolchain if found
- Throws:
ToolchainManagerException
- if toolchain retrieval fails
-
storeToolchainToBuildContext
Description copied from interface:ToolchainManager
Stores a toolchain in the build context for later retrieval.- Specified by:
storeToolchainToBuildContext
in interfaceToolchainManager
- Parameters:
session
- The Maven session contexttoolchain
- The toolchain to store
-
getToolchains
@Nonnull public List<Toolchain> getToolchains(@Nonnull Session session, @Nonnull String type) throws ToolchainManagerException Description copied from interface:ToolchainManager
Retrieves all toolchains of the specified type without additional requirements.- Specified by:
getToolchains
in interfaceToolchainManager
- Parameters:
session
- The Maven session contexttype
- The type of toolchain to retrieve- Returns:
- List of matching toolchains, never null
- Throws:
ToolchainManagerException
- if toolchain retrieval fails
-