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

Difference in root path when using job-dsl-plugin in jenkins versus standalone

    Details

    • Similar Issues:

      Description

      I can run job-dsl-plugin without problem from within Jenkins but when I run the standalone plugin from the same directory( workspace root) as inside Jenkins I get problem with imports in my *.dsl files.
      They are placed in the same directory as my *.dsl files and the imports works fine when I run the standalone plugin in the same directory, but when I move to the workspace root it does not work.
      I have tried to change the imports from "import constants" into "import project1/dsls/constants" and add package declarations in the imported files like "package project1.dsls" and that works but then it does not work from inside Jenkins anymore.

      Example file structure:

      - workspace( Jenkins)
        - scripts
          - start.groovy
        - project1
          - dsls
            - dsl1.dsl
            - dsl2.dsl
            - constants
      

        Attachments

          Activity

          perarne Per-Arne Landström created issue -
          perarne Per-Arne Landström made changes -
          Field Original Value New Value
          Description I can run job-dsl-plugin without problem from within Jenkins but when I run the standalone plugin from the same directory( workspace root) as inside Jenkins I get problem with imports in my *.dsl files.
          They are placed in the same directory as my *.dsl files and the imports works fine when I run the standalone plugin in the same directory, but when I move to the workspace root it does not work.
          I have tried to change the imports from "import constants" into "import project1/dsls/constants" and add package declarations in the imported files like "package project1.dsls" and that works but then it does not work from inside Jenkins anymore.

          Example file structure:

          - workspace( Jenkins)
            - scripts
              - start.groovy
            - project1
              - dsls
                - dsl1.dsl
                - dsl2.dsl
                - constants
          I can run job-dsl-plugin without problem from within Jenkins but when I run the standalone plugin from the same directory( workspace root) as inside Jenkins I get problem with imports in my *.dsl files.
          They are placed in the same directory as my *.dsl files and the imports works fine when I run the standalone plugin in the same directory, but when I move to the workspace root it does not work.
          I have tried to change the imports from "import constants" into "import project1/dsls/constants" and add package declarations in the imported files like "package project1.dsls" and that works but then it does not work from inside Jenkins anymore.

          Example file structure:


          {noformat}
          - workspace( Jenkins)
            - scripts
              - start.groovy
            - project1
              - dsls
                - dsl1.dsl
                - dsl2.dsl
                - constants
          {noformat}

          scm_issue_link SCM/JIRA link daemon made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          daspilker Daniel Spilker made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              daspilker Daniel Spilker
              Reporter:
              perarne Per-Arne Landström
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: