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

Jenkins $WORKSPACE variable override project internal properties "workspace"

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • core
    • Ubuntu server 12.04.2 LTS
      Jenkins 1.558

      In a Maven Java project of mine, I've got an injected property called "workspace" which is overridden at runtime by Jenkins own $WORKSPACE.

      This property is in a .property file read by Spring configuration.

      A simple workaround would be to rename mine, but far from acceptable, as it shouldn't be up to Jenkins to force project inner properties name.

      Does someone have any other idea ?

      Also, to avoid such problem, Jenkins environment variables should be prefixed by a namespace like "$JENKINS_WORKSPACE", IMHO.

          [JENKINS-24000] Jenkins $WORKSPACE variable override project internal properties "workspace"

          Daniel Beck added a comment -

          Either change would be a severe regression in any existing installation relying on the current behavior, so is out of the question. Therefore closing this as Won't Fix.

          That said, it may depend on how you launch your Maven build: Is it a Maven project? A Maven build step in a freestyle project? What happens when you switch to the other?

          For advice on how to configure your project, please try IRC or the jenkinsci-users mailing ist.

          Daniel Beck added a comment - Either change would be a severe regression in any existing installation relying on the current behavior, so is out of the question. Therefore closing this as Won't Fix. That said, it may depend on how you launch your Maven build: Is it a Maven project? A Maven build step in a freestyle project? What happens when you switch to the other? For advice on how to configure your project, please try IRC or the jenkinsci-users mailing ist.

          Mathieu BODIN added a comment -

          Thank you for the quick answer, even a bit disappointing (a little, just saying.... ) but I do understand.

          For the record, it's a Maven build. There's a lot of modules, I won't have time to switch to another project type.

          I'll just rename my variable, as I should practice what I suggested : It's a good practice to use namespace on properties, even if it length their names.

          Mathieu BODIN added a comment - Thank you for the quick answer, even a bit disappointing (a little, just saying.... ) but I do understand. For the record, it's a Maven build. There's a lot of modules, I won't have time to switch to another project type. I'll just rename my variable, as I should practice what I suggested : It's a good practice to use namespace on properties, even if it length their names.

            Unassigned Unassigned
            mathieubodin Mathieu BODIN
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: