Class NexusRetriever

java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.libs.LibraryRetriever>
org.jenkinsci.plugins.workflow.libs.LibraryRetriever
com.roylenferink.jenkins.plugins.workflow.libs.NexusRetriever
All Implemented Interfaces:
ExtensionPoint, Describable<org.jenkinsci.plugins.workflow.libs.LibraryRetriever>

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class NexusRetriever extends org.jenkinsci.plugins.workflow.libs.LibraryRetriever
The goal of this plugin is to provide another way to retrieve shared libraries via the @Library declaration in a Jenkinsfile.

The current official pipeline-groovy-lib-plugin only provides a way to retrieve shared libraries through an SCM, such as Git, Subversion, etc.

  • Constructor Details

    • NexusRetriever

      @DataBoundConstructor public NexusRetriever(@NonNull String artifactDetails, @NonNull String mavenHome)
      Constructor
  • Method Details

    • getArtifactDetails

      public String getArtifactDetails()
    • getMavenHome

      public String getMavenHome()
    • retrieve

      public void retrieve(@NonNull String name, @NonNull String version, @NonNull FilePath target, @NonNull Run<?,?> run, @NonNull TaskListener listener) throws Exception
      Retrieves the shared library code. Prefer this version of the method.

      Checks first if the library is accessible via a HEAD call. Then retrieves the shared library from Nexus.

      Specified by:
      retrieve in class org.jenkinsci.plugins.workflow.libs.LibraryRetriever
      Parameters:
      name - Name of the library (as specified in the Jenkinsfile @Library)
      version - Version of the library (as specified in the Jenkinsfile @Library)
      target - Where the code should be retrieved
      run - Jenkins context
      listener - Only used to get the logger
      Throws:
      Exception - if the file cannot be downloaded, archive can't be extracted, workspace is not writable
    • retrieve

      public void retrieve(@NonNull String name, @NonNull String version, boolean changelog, @NonNull FilePath target, @NonNull Run<?,?> run, @NonNull TaskListener listener) throws Exception
      Checks first if the library is accessible via a HEAD call. Then retrieves the shared library from Nexus.
      Specified by:
      retrieve in class org.jenkinsci.plugins.workflow.libs.LibraryRetriever
      Parameters:
      name - Name of the library (as specified in the Jenkinsfile @Library)
      version - Version of the library (as specified in the Jenkinsfile @Library)
      changelog - Not used
      target - Where the code should be retrieved
      run - Jenkins context
      listener - Only used to get the logger
      Throws:
      Exception - if the file cannot be downloaded, archive can't be extracted, workspace is not writable
    • getDescriptor

      public org.jenkinsci.plugins.workflow.libs.LibraryRetrieverDescriptor getDescriptor()
      Specified by:
      getDescriptor in interface Describable<org.jenkinsci.plugins.workflow.libs.LibraryRetriever>
      Overrides:
      getDescriptor in class org.jenkinsci.plugins.workflow.libs.LibraryRetriever