Class SCMSourceRetriever
java.lang.Object
hudson.model.AbstractDescribableImpl<LibraryRetriever>
org.jenkinsci.plugins.workflow.libs.LibraryRetriever
org.jenkinsci.plugins.workflow.libs.SCMBasedRetriever
org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever
- All Implemented Interfaces:
ExtensionPoint
,Describable<LibraryRetriever>
Uses
SCMSource.fetch(String, TaskListener)
to retrieve a specific revision.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from class org.jenkinsci.plugins.workflow.libs.SCMBasedRetriever
SCMBasedRetriever.SCMBasedRetrieverDescriptor, SCMBasedRetriever.WorkspaceListener
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class org.jenkinsci.plugins.workflow.libs.SCMBasedRetriever
INCLUDE_SRC_TEST_IN_LIBRARIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjenkins.scm.api.SCMSource
getScm()
A source of SCM checkouts.void
retrieve
(String name, String version, boolean changelog, FilePath target, Run<?, ?> run, TaskListener listener) Obtains library sources.void
Obtains library sources.validateVersion
(String name, String version, Item context) Offer to validate a proposedversion
forLibraryRetriever.retrieve(java.lang.String, java.lang.String, boolean, hudson.FilePath, hudson.model.Run<?, ?>, hudson.model.TaskListener)
.Methods inherited from class org.jenkinsci.plugins.workflow.libs.SCMBasedRetriever
doRetrieve, getLibraryPath, isClone, retrySCMOperation, setClone, setLibraryPath
Methods inherited from class org.jenkinsci.plugins.workflow.libs.LibraryRetriever
getDescriptor, validateVersion
-
Constructor Details
-
SCMSourceRetriever
@DataBoundConstructor public SCMSourceRetriever(jenkins.scm.api.SCMSource scm)
-
-
Method Details
-
getScm
public jenkins.scm.api.SCMSource getScm()A source of SCM checkouts. -
retrieve
public void retrieve(String name, String version, boolean changelog, FilePath target, Run<?, ?> run, TaskListener listener) throws ExceptionDescription copied from class:LibraryRetriever
Obtains library sources.- Specified by:
retrieve
in classLibraryRetriever
- 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 void retrieve(String name, String version, FilePath target, Run<?, ?> run, TaskListener listener) throws ExceptionDescription copied from class:LibraryRetriever
Obtains library sources.- Specified by:
retrieve
in classLibraryRetriever
- 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
Description copied from class:LibraryRetriever
Offer to validate a proposedversion
forLibraryRetriever.retrieve(java.lang.String, java.lang.String, boolean, hudson.FilePath, hudson.model.Run<?, ?>, hudson.model.TaskListener)
.- Overrides:
validateVersion
in classLibraryRetriever
- Parameters:
name
- the proposed library nameversion
- a proposed versioncontext
- optional context in which this runs- Returns:
- by default, OK
-