Class DefaultToolchainManager
java.lang.Object
org.apache.maven.impl.DefaultToolchainManager
- All Implemented Interfaces:
Service,ToolchainManager
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDefaultToolchainManager(Map<String, ToolchainFactory> factories) protectedDefaultToolchainManager(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) voidstoreToolchainToBuildContext(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, waitMethods 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:ToolchainManagerRetrieves toolchains matching the specified type and requirements.- Specified by:
getToolchainsin 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:ToolchainManagerRetrieves the currently active toolchain from the build context.- Specified by:
getToolchainFromBuildContextin 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:ToolchainManagerStores a toolchain in the build context for later retrieval.- Specified by:
storeToolchainToBuildContextin interfaceToolchainManager- Parameters:
session- The Maven session contexttoolchain- The toolchain to store
-
retrieveContext
-