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>
public class SCMSourceRetriever extends SCMBasedRetriever
UsesSCMSource.fetch(String, TaskListener)
to retrieve a specific revision.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SCMSourceRetriever.DescriptorImpl
static class
SCMSourceRetriever.Hider
-
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
Constructors Constructor Description SCMSourceRetriever(jenkins.scm.api.SCMSource scm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jenkins.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
retrieve(String name, String version, FilePath target, Run<?,?> run, TaskListener listener)
Obtains library sources.FormValidation
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
-
-
-
-
Method Detail
-
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 Exception
Description 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 Exception
Description 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
public FormValidation validateVersion(String name, String version, Item context)
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
-
-