Pipeline - plugin does not find SCMs on first execution

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

       This issue was reported by an user at github here.

      The issue is that the plugin is failing to getSCM in a pipeline run only on the first time, here is the code used by the plugin:

      Collection<? extends SCM> scms = SCMTriggerItem.SCMTriggerItems.asSCMTriggerItem(projectAction.getProject()).getSCMs();
      

      scms is _ null _ when we run the pipeline script below, only for the first time:

       

      node() {
        def STOP_ON_ERROR = '';
        def mvnHome
        def javaHome
        def failed = false;
        try{
          stage('Preparation') { // for display purposes
            // Get the Maven tool.
            // ** NOTE: This 'M3' Maven tool must be configured
            // **       in the global configuration.
            checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/thomas-oo/eventAppFrontend']]])
          }
        }catch(Exception e){
          failed = true
          echo 'Build failed'
        }finally{
          if(!failed){
            stage('Last Changes'){
              echo 'In last changes'
              step([$class: 'LastChangesPublisher', format: 'LINE', matchWordsThreshold: '0.25', matching: 'NONE', matchingMaxComparisons: '1000', showFiles: true, synchronisedScroll: true, endRevision: ''])
            }
          }
          echo 'In finally block'
        }
      }

       

       

       

       

            Assignee:
            Rafael Pestano
            Reporter:
            Rafael Pestano
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: