Interface MojoMetadataProvider.Context.Outputs
-
- Enclosing interface:
- MojoMetadataProvider.Context
public static interface MojoMetadataProvider.Context.Outputs
The outputs of a goal are packed into the cache entry and restored when they are loaded from the build cache. Every goal execution starts out as "not supported". It has to be explicitly marked as cacheable in order to benefit from build caching. If any reason for being non-cacheable is given (e.g. vianotCacheableBecause(String)
), the goal execution's outputs will not be cached, even if it was marked as cacheable.- Since:
- 1.15
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MojoMetadataProvider.Context.Outputs
cacheable(java.lang.String reason)
Marks the outputs of this goal execution as cacheable.MojoMetadataProvider.Context.Outputs
directory(java.lang.String propertyName)
Marks the given property as an output directory.MojoMetadataProvider.Context.Outputs
directory(java.lang.String propertyName, java.lang.Object directory)
Registers the given file as an output property.MojoMetadataProvider.Context.Outputs
file(java.lang.String propertyName)
Marks the given property as an output file.MojoMetadataProvider.Context.Outputs
file(java.lang.String propertyName, java.lang.Object file)
Registers the given file as an output property.MojoMetadataProvider.Context.Outputs
notCacheableBecause(java.lang.String reason)
Disables caching of the outputs of this goal execution.MojoMetadataProvider.Context.Outputs
storeEnabled(boolean enabled)
Configures whether results for this goal should be stored in the build cache or only read from it.
-
-
-
Method Detail
-
file
MojoMetadataProvider.Context.Outputs file(java.lang.String propertyName)
Marks the given property as an output file.- Parameters:
propertyName
- the name of the property to be marked as an output file- Since:
- 1.15
- See Also:
file(String, Object)
-
file
MojoMetadataProvider.Context.Outputs file(java.lang.String propertyName, java.lang.Object file)
Registers the given file as an output property.- Parameters:
propertyName
- the name of the property to be registered as an output filefile
- can be aString
,Path
,URI
orFile
represented through an absolute or a relative path to a file. If it is a relative path, it will be resolved using the current project's base directory.- Since:
- 1.15
-
directory
MojoMetadataProvider.Context.Outputs directory(java.lang.String propertyName)
Marks the given property as an output directory.- Parameters:
propertyName
- the name of the property to be marked as an output directory- Since:
- 1.15
- See Also:
directory(String, Object)
-
directory
MojoMetadataProvider.Context.Outputs directory(java.lang.String propertyName, java.lang.Object directory)
Registers the given file as an output property.- Parameters:
propertyName
- the name of the property to be registered as an output directorydirectory
- can be aString
,Path
,URI
orFile
represented through an absolute or a relative path to a directory. If it is a relative path, it will be resolved using the current project's base directory.- Since:
- 1.15
-
cacheable
MojoMetadataProvider.Context.Outputs cacheable(java.lang.String reason)
Marks the outputs of this goal execution as cacheable. The supplied reason should fit well in the following sentence: "Build caching was enabled for this goal execution because ...".- Parameters:
reason
- the reason why the goal execution's outputs are cacheable- Since:
- 1.15
-
notCacheableBecause
MojoMetadataProvider.Context.Outputs notCacheableBecause(java.lang.String reason)
Disables caching of the outputs of this goal execution. The supplied reason should fit well in the following sentence: "Build caching was not enabled for this goal execution because ...".- Parameters:
reason
- the reason why the goal execution's outputs are not cacheable- Since:
- 1.15
-
storeEnabled
MojoMetadataProvider.Context.Outputs storeEnabled(boolean enabled)
Configures whether results for this goal should be stored in the build cache or only read from it. This can be useful when the outputs of this goal are only safe to be stored under certain circumstances, e.g. only on clean builds or only on CI builds.- Parameters:
enabled
- whether results for this goal should be stored in the build cache- Since:
- 1.15
-
-