<?xml version='1.0' encoding='UTF-8'?>
<project>
  <actions/>
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <hudson.plugins.heavy__job.HeavyJobProperty plugin="heavy-job@1.0">
      <weight>1</weight>
    </hudson.plugins.heavy__job.HeavyJobProperty>
    <de.pellepelster.jenkins.walldisplay.WallDisplayJobProperty plugin="jenkinswalldisplay@0.6.16"/>
  </properties>
  <scm class="hudson.scm.NullSCM"/>
  <assignedNode>slave-01</assignedNode>
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <jdk>(Default)</jdk>
  <triggers class="vector"/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
      <command># create a small script which gets called by the exec in the maven pom. This simply outputs the DISPLAY variable:
cat &gt;test.sh &lt;&lt;&apos;EOF&apos;
#!/bin/sh
echo &apos;*************************&apos;
env | fgrep DISPLAY
echo &apos;*************************&apos;
EOF
chmod 755 test.sh

# create a pom, which calls the above shell script
cat &gt;pom.xml &lt;&lt;&apos;EOF&apos;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
   &lt;groupId&gt;freestyle&lt;/groupId&gt;
   &lt;artifactId&gt;sample&lt;/artifactId&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
   &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
   &lt;build&gt;
      &lt;plugins&gt;
         &lt;plugin&gt;
            &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
            &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;1.2.1&lt;/version&gt;
            &lt;executions&gt;
               &lt;execution&gt;
                  &lt;id&gt;show-display&lt;/id&gt;
                  &lt;phase&gt;compile&lt;/phase&gt;
                  &lt;goals&gt;
                     &lt;goal&gt;exec&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;configuration&gt;
                     &lt;executable&gt;test.sh&lt;/executable&gt;
                  &lt;/configuration&gt;
               &lt;/execution&gt;
            &lt;/executions&gt;
         &lt;/plugin&gt;
      &lt;/plugins&gt;
   &lt;/build&gt;
&lt;/project&gt;
EOF

# download dependencies silently to not clutter the output below
mvn -B -q compile &gt;/dev/null 2&gt;&amp;1</command>
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
      <command>echo
echo Running shell, this shows the correct output:
mvn -B -q compile

echo
echo Now running Maven buildstep, this shows the wrong output:</command>
    </hudson.tasks.Shell>
    <hudson.tasks.Maven>
      <targets>-B -q compile</targets>
      <mavenName>(Default)</mavenName>
      <usePrivateRepository>false</usePrivateRepository>
      <settings class="jenkins.mvn.DefaultSettingsProvider"/>
      <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
    </hudson.tasks.Maven>
  </builders>
  <publishers/>
  <buildWrappers>
    <org.jenkinsci.plugins.xvfb.XvfbBuildWrapper plugin="xvfb@1.0.7">
      <installationName>Default</installationName>
      <screen>1024x768x24</screen>
      <debug>false</debug>
      <timeout>0</timeout>
      <displayNameOffset>1</displayNameOffset>
      <additionalOptions></additionalOptions>
      <shutdownWithBuild>false</shutdownWithBuild>
    </org.jenkinsci.plugins.xvfb.XvfbBuildWrapper>
  </buildWrappers>
</project>