Class LibraryRetriever
java.lang.Object
hudson.model.AbstractDescribableImpl<LibraryRetriever>
org.jenkinsci.plugins.workflow.libs.LibraryRetriever
- All Implemented Interfaces:
ExtensionPoint
,Describable<LibraryRetriever>
- Direct Known Subclasses:
SCMBasedRetriever
public abstract class LibraryRetriever
extends AbstractDescribableImpl<LibraryRetriever>
implements ExtensionPoint
A way in which a library can be physically obtained for use in a build.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
retrieve
(String name, String version, boolean changelog, FilePath target, Run<?, ?> run, TaskListener listener) Obtains library sources.abstract void
Obtains library sources.validateVersion
(String name, String version) Deprecated.validateVersion
(String name, String version, Item context) Offer to validate a proposedversion
forretrieve(java.lang.String, java.lang.String, boolean, hudson.FilePath, hudson.model.Run<?, ?>, hudson.model.TaskListener)
.
-
Constructor Details
-
LibraryRetriever
public LibraryRetriever()
-
-
Method Details
-
retrieve
public abstract void retrieve(@NonNull String name, @NonNull String version, boolean changelog, @NonNull FilePath target, @NonNull Run<?, ?> run, @NonNull TaskListener listener) throws ExceptionObtains library sources.- Parameters:
name
- theLibraryConfiguration.getName()
version
- the version of the library, such as fromLibraryConfiguration.getDefaultVersion()
or an overridechangelog
- whether to include changesets in the library in jobs using it fromLibraryConfiguration.getIncludeInChangesets()
target
- a directory in which to check out sources; should createsrc/**
/*.groovy
and/orvars/*.groovy
, and optionally alsoresources/
run
- a build which will use the librarylistener
- a way to report progress- Throws:
Exception
- if there is any problem (useAbortException
for user errors)
-
retrieve
public abstract void retrieve(@NonNull String name, @NonNull String version, @NonNull FilePath target, @NonNull Run<?, ?> run, @NonNull TaskListener listener) throws ExceptionObtains library sources.- Parameters:
name
- theLibraryConfiguration.getName()
version
- the version of the library, such as fromLibraryConfiguration.getDefaultVersion()
or an overridetarget
- a directory in which to check out sources; should createsrc/**
/*.groovy
and/orvars/*.groovy
, and optionally alsoresources/
run
- a build which will use the librarylistener
- a way to report progress- Throws:
Exception
- if there is any problem (useAbortException
for user errors)
-
validateVersion
Deprecated. -
validateVersion
public FormValidation validateVersion(@NonNull String name, @NonNull String version, @CheckForNull Item context) Offer to validate a proposedversion
forretrieve(java.lang.String, java.lang.String, boolean, hudson.FilePath, hudson.model.Run<?, ?>, hudson.model.TaskListener)
.- Parameters:
name
- the proposed library nameversion
- a proposed versioncontext
- optional context in which this runs- Returns:
- by default, OK
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<LibraryRetriever>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<LibraryRetriever>
-