0

After running gui tests on Jenkins I am getting java.awt.HeadlessException on build Jenkins:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

I am using xvfb in pipeline Jenkins (script), eclipse & maven.

How coud I solve this issue via Jenkins file (script) or maven pom or in another way?

Why am I getting this exception?

user3450666
  • 45
  • 1
  • 1
  • 5

1 Answers1

1

Somewhere in your pipeline you probably need to have export DISPLAY=:0.0 or something similar.

James Holmes
  • 394
  • 2
  • 5
  • my jenkins script looks like wrap([$class: 'Xvfb', installationName: 'xvfb']) { withEnv(['DISPLAY=:0']) { sh "mvn clean verify -U -B } However this doesn't work. I think that withEnv(['DISPLAY=:0']) is not correct ? – user3450666 May 07 '19 at 09:56