# Using different versions of shared library scripts(Global variables) from the same repository

**URL:** <https://community.jenkins.io/t/using-different-versions-of-shared-library-scripts-global-variables-from-the-same-repository/20129>\
**Category:** Ask a question\
**Tags:** question, pipeline\
**Created:** [September 25, 2024, 12:14pm UTC](https://community.jenkins.io/t/using-different-versions-of-shared-library-scripts-global-variables-from-the-same-repository/20129 "2024-09-25T12:14:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![premP](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@premP](https://community.jenkins.io/u/premP)\
**Post date:** [September 25, 2024, 12:14pm UTC](https://community.jenkins.io/t/using-different-versions-of-shared-library-scripts-global-variables-from-the-same-repository/20129/1 "2024-09-25T12:14:39Z")

</div>

Hi,

I’m looking for a way to load a single shared library (either implicitly or explicitly) in a pipeline, but still be able to access different versions of scripts from that library. For example, I want to use “global variable 1” from version 1.0.0 and “global variable 2” from version 2.0.0 within the same pipeline, without needing multiple shared libraries.

When I tried dynamically loading different library versions at each stage, I got this message: “Only using first definition of library .”

I want to avoid setting up multiple repositories for shared libraries if possible.

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [September 30, 2024, 9:31am UTC](https://community.jenkins.io/t/using-different-versions-of-shared-library-scripts-global-variables-from-the-same-repository/20129/2 "2024-09-30T09:31:32Z")

</div>

Hello and welcome to this community, @premP. 👋

As far as I know, in Jenkins, you can only load a single version of a shared library at a time.
