Package org.apache.maven.impl
Class DefaultToolchainManager
java.lang.Object
org.apache.maven.impl.DefaultToolchainManager
- All Implemented Interfaces:
Service
,ToolchainManager
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDefaultToolchainManager
(Map<String, ToolchainFactory> factories) protected
DefaultToolchainManager
(Map<String, ToolchainFactory> factories, org.slf4j.Logger logger) Used for tests only -
Method Summary
Modifier and TypeMethodDescriptiongetToolchainFromBuildContext
(Session session, String type) Retrieves the currently active toolchain from the build context.Retrieves toolchains matching the specified type and requirements.retrieveContext
(Session session) void
storeToolchainToBuildContext
(Session session, Toolchain toolchain) Stores a toolchain in the build context for later retrieval.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.api.services.ToolchainManager
getToolchains
-
Constructor Details
-
DefaultToolchainManager
-
DefaultToolchainManager
Used for tests only
-
-
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
-
retrieveContext
-