<p><a href="https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/demos/jenkins/jenkins.yaml" rel="nofollow noreferrer">https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/demos/jenkins/jenkins.yaml</a></p>

<p>It should be possible by configuring it like this:</p>

<pre><code>unclassified:
  globalLibraries:
    libraries:
      - name: "some-lib"
        retriever:
          modernSCM:
            scm:
              git:
                remote: "https://github.com/some-project.git"
                credentialsId: 'some-credentials'
</code></pre>

CC BY-SA 4.0
2019-09-20T22:18:17.470Z
2019-09-20T22:18:17.470Z
030
<p>This Q&amp;A is related to <a href="https://devops.stackexchange.com/q/9225/210">this</a> one and is slightly different. </p>

<jenkins><jcac>
How to set a shared-library globally using the JCASC plugin?
030
# How to set a shared-library globally using the JCASC plugin?

(Asked by: username_0 on 2019-09-20)

This Q&A is related to [this](https://devops.stackexchange.com/q/9225/210) one and is slightly different.

**Tags:** jenkins, jcac


---

## 1 answers

### Answer by username_0 on 2019-09-20. Score: 1 | Accepted answer

https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/demos/jenkins/jenkins.yaml
It should be possible by configuring it like this:
unclassified:
  globalLibraries:
    libraries:
      - name: "some-lib"
        retriever:
          modernSCM:
            scm:
              git:
                remote: "https://github.com/some-project.git"
                credentialsId: 'some-credentials'


---

