-
Improvement
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
Debian 6.0.3
Jenkins 1.501
Xvfb plugin 1.0.7
For a freestyle project with an "Invoke top-level Maven targets" build step and the Xvfb plugin enabled, the display number is not passed in the DISPLAY environment variable, but as a property, instead:
jenkins@ci4:~$ env|grep DISPLAY DISPLAY=:85 jenkins@ci4:~$ ps -ef|grep firef jenkins 31202 22976 0 17:48 ? 00:00:00 /bin/sh /opt/maven3.0.4/bin/mvn -f pom.xml -Dtestsuite=Document -DDISPLAY=:7 clean install -B -Dwebdriver.firefox.bin=/opt/firefox-esr/firefox -Dtest=TestSuiteDocument -Djava.io.tmpdir=/home/jenkins/workspace/selenium-tests/tmp -Dmaven.repo.local=/home/jenkins/workspace/selenium-tests/.repository jenkins 31236 31202 19 17:48 ? 00:00:09 /opt/java/bin/java -Djava.io.tmpdir=/tmp/tmp_maven.31202.tmp -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -classpath /opt/maven3.0.4/boot/plexus-classworlds-2.4.jar -Dclassworlds.conf=/opt/maven3.0.4/bin/m2.conf -Dmaven.home=/opt/maven3.0.4 org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -Dtestsuite=Document -DDISPLAY=:7 clean install -B -Dwebdriver.firefox.bin=/opt/firefox-esr/firefox -Dtest=TestSuiteDocument -Djava.io.tmpdir=/home/jenkins/workspace/selenium-tests/tmp -Dmaven.repo.local=/home/jenkins/workspace/selenium-tests/.repository jenkins 31375 31323 40 17:49 ? 00:00:16 /opt/firefox-esr/firefox -foreground jenkins 31416 27994 0 17:49 pts/0 00:00:00 grep firef jenkins@ci4:~$ sed -e 's/.*DISPLAY=//' /proc/31375/environ :85...
Outside of the build, the DISPLAY variable is set to :85, Jenkins passes -DDISPLAY=:7 to Maven, but the firefox process still has DISPLAY=:85 in its environment.
If we convert our build step to "Execute shell", everything works as expected but then we have to "hard-code" the Maven version instead of choosing one from the Maven installations that we configured globally.
Would it be hard to change the behaviour so that the DISPLAY environment variable gets set instead, or in addition to the Java property?
Hi Uwe, are you certain that jenkins started the firefox process? From what I see in your example output parent process of the firefox process has PID 31323, whilst maven/java processes have PID 31236 and 31202.
DISPLAY environment variable should be set in all processes started by the jenkins job, even in the ones started by "Invoke top-level Maven targets". You can check this with exec-maven-plugin, i.e.: