Maven Surefire
  1. Maven Surefire
  2. SUREFIRE-764

java.io.tmpdir from MAVEN_OPTS should be inherited when forking

    Details

      Description

      For Maven 3 freestyle jobs in Hudson you can select "Private temporary directory". This will set "MAVEN_OPTS=-Djava.io.tmpdir=..." for the Maven execution.
      However, surefire/failsafe plugin forks by default and the forked process will then not be using this temp directory as the new JVM settings are not inherited from MAVEN_OPTS.

      I'm suggesting that java.io.tmpdir should be inherited from MAVEN_OPTS, if specified.

        Activity

        Hide
        Tibor Digana added a comment - - edited

        @Anders
        I guess this won't be possible in 2.x.

        You can use

        <argLine>${env.MAVEN_OPTS}</argLine>
        

        We don't want to add new configuration parameter right before the EO surefire 2.x.
        I guess in surefire 3.0 you should have a chance to hack surefire and failsafe via SPI, Java 8 extra module, maybe Bash Shell, JavaScript or so, without asking us to do it.
        Do you agree with me to assign this issue to 3.0?

        Show
        Tibor Digana added a comment - - edited @Anders I guess this won't be possible in 2.x. You can use <argLine>${env.MAVEN_OPTS}</argLine> We don't want to add new configuration parameter right before the EO surefire 2.x. I guess in surefire 3.0 you should have a chance to hack surefire and failsafe via SPI, Java 8 extra module, maybe Bash Shell, JavaScript or so, without asking us to do it. Do you agree with me to assign this issue to 3.0?
        Hide
        Anders Hammar added a comment -

        Sure, that's ok.

        Show
        Anders Hammar added a comment - Sure, that's ok.
        Hide
        Tibor Digana added a comment - - edited

        In my imagination the user of surefire 3.0 should be able do this:

        function onMojoParameter(mavenSession, mavenProject, property) {
        var val = property.name == "argLine" ? property.value + " -Djava.io.tmpdir=/tmp" : property.value;
        return {name: property.name, value: val, default: property.default};
        }
        
        Show
        Tibor Digana added a comment - - edited In my imagination the user of surefire 3.0 should be able do this: function onMojoParameter(mavenSession, mavenProject, property) { var val = property.name == "argLine" ? property.value + " -Djava.io.tmpdir=/tmp" : property.value; return {name: property.name, value: val, default : property. default }; }
        Hide
        Tibor Digana added a comment -

        I guess <argLine>$

        {env.MAVEN_OPTS}

        </argLine> is pretty good solution instead of promising a hack in surefire 3.0.

        Show
        Tibor Digana added a comment - I guess <argLine>$ {env.MAVEN_OPTS} </argLine> is pretty good solution instead of promising a hack in surefire 3.0.

          People

          • Assignee:
            Unassigned
            Reporter:
            Anders Hammar
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development