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. via
notCacheableBecause(String)
), the goal execution's outputs will
not be cached, even if it was marked as cacheable.- Since:
- 1.15
-
Method Summary
Modifier and TypeMethodDescriptionMarks the outputs of this goal execution as cacheable.Marks the given property as an output directory.Registers the given file as an output property.Marks the given property as an output file.Registers the given file as an output property.notCacheableBecause
(String reason) Disables caching of the outputs of this goal execution.storeEnabled
(boolean enabled) Configures whether results for this goal should be stored in the build cache or only read from it.
-
Method Details
-
file
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
Registers the given file as an output property. -
directory
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
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
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
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
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
-