com.gradle.develocity.agent.maven.api.cache.BuildCacheApi Maven / Gradle / Ivy
Show all versions of develocity-maven-extension Show documentation
package com.gradle.develocity.agent.maven.api.cache;
/**
* Configures the local and remote build cache.
*
* @since 1.21
*/
public interface BuildCacheApi {
/**
* Gets the local build cache configuration.
*
* @return the local build cache configuration
*/
LocalBuildCache getLocal();
/**
* Gets the remote build cache configuration.
*
* @return the remote build cache configuration
*/
RemoteBuildCache getRemote();
/**
* Whether the {@code clean} lifecycle phase is required in order to use the build cache.
*
* @return {@code true} if {@code clean} is required; {@code false}, otherwise
*/
boolean isRequireClean();
/**
* Sets whether the {@code clean} lifecycle phase is required in order to use the build cache.
*
* You should only set this to {@code false} when the build is started from a clean working directory.
* Otherwise, produced build cache entries may be incorrect.
*
* Configuration via the {@code develocity.cache.requireClean} system property will always take precedence.
*
* @param requireClean whether {@code clean} is required in order to use the build cache.
*/
void setRequireClean(boolean requireClean);
/**
* Registers a {@link MojoMetadataProvider}, which allows users to configure caching for Mojos
* that the Develocity Maven extension does not support out of the box.
*
* @param metadataProvider the metadata provider, must not be null
*/
void registerMojoMetadataProvider(MojoMetadataProvider metadataProvider);
/**
* Registers a {@link NormalizationProvider}, which allows to configure
* runtime classpath normalization.
*
* This can be used to ignore volatile data on the runtime classpath that does not
* influence the outcome of goals, e.g. test goals. For more information, please consult
* the user manual.
*
* @param normalizationProvider the normalization provider, must not be null
*/
void registerNormalizationProvider(NormalizationProvider normalizationProvider);
}