Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13779

Git Publisher (tagging) can't work with multipe SCM (ClassCastException: org.jenkinsci.plugins.multiplescms.MultiSCM cannot be cast to hudson.plugins.git.GitSCM)

    Details

    • Similar Issues:

      Description

      when using multiple SCM plugin together with Git Publisher the git publisher shows and ERROR message:
      (can we use for "Target remote name" the name specified in SCM?

      Status Code: 500

      Exception:
      Stacktrace:
      java.lang.ClassCastException: org.jenkinsci.plugins.multiplescms.MultiSCM cannot be cast to hudson.plugins.git.GitSCM
      at hudson.plugins.git.GitPublisher$DescriptorImpl.doCheckRemote(GitPublisher.java:424)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:488)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:162)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:63)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
      at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:215)
      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:138)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

        Attachments

          Activity

          Hide
          jekeller Jacob Keller added a comment - - edited

          So the problem is that we can't generically support each type of SCM wrapper, and I don't think the maintainer wants to put unnecessary dependency on plugins which aren't required to use Git..?

          Is there a way to optionally add dependency without requiring they all be installed?

          Show
          jekeller Jacob Keller added a comment - - edited So the problem is that we can't generically support each type of SCM wrapper, and I don't think the maintainer wants to put unnecessary dependency on plugins which aren't required to use Git..? Is there a way to optionally add dependency without requiring they all be installed?
          Hide
          wsaxon Will Saxon added a comment -

          I was looking at extending something the other day, and the docs said you can a) add the plugin to the pom.xml and specify <optional>true</optional> on it, and b) use the optional=true modifier on the @Extension attribute if appropriate.

          Show
          wsaxon Will Saxon added a comment - I was looking at extending something the other day, and the docs said you can a) add the plugin to the pom.xml and specify <optional>true</optional> on it, and b) use the optional=true modifier on the @Extension attribute if appropriate.
          Hide
          jekeller Jacob Keller added a comment -

          Ok. That would help. But what if I'm not adding an extention point, just trying to use a class, ie: I need to be able to check if the SCM is a multi-scm? I don't know if that is reasonably doable or not...

          Show
          jekeller Jacob Keller added a comment - Ok. That would help. But what if I'm not adding an extention point, just trying to use a class, ie: I need to be able to check if the SCM is a multi-scm? I don't know if that is reasonably doable or not...
          Hide
          rodrigc Craig Rodrigues added a comment -

          Suggest that you migrate to Pipeline plugin, which offers a supported way of checking out from multiple scms
          https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin

          Show
          rodrigc Craig Rodrigues added a comment - Suggest that you migrate to Pipeline plugin, which offers a supported way of checking out from multiple scms https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin
          Hide
          olivergondza Oliver Gondža added a comment -

          Craig Rodrigues, Is there any support for pushing in pipeline? I do not see that on https://jenkins.io/doc/pipeline/steps/ for git or workflow-scm-step. In case users are expected to run that from shell, I do not think this justify as closing reason since used could do that with freestyle as well (multiple SCMs + git push from shell). Consuming credentials from Jenkins is one problem I can see.

          Show
          olivergondza Oliver Gondža added a comment - Craig Rodrigues , Is there any support for pushing in pipeline? I do not see that on https://jenkins.io/doc/pipeline/steps/ for git or workflow-scm-step. In case users are expected to run that from shell, I do not think this justify as closing reason since used could do that with freestyle as well (multiple SCMs + git push from shell). Consuming credentials from Jenkins is one problem I can see.

            People

            • Assignee:
              jekeller Jacob Keller
              Reporter:
              casey1911 Stanislav Jursky
            • Votes:
              21 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

              • Created:
                Updated: