false
1
slave-01
false
false
false
false
(Default)
false
# create a small script which gets called by the exec in the maven pom. This simply outputs the DISPLAY variable:
cat >test.sh <<'EOF'
#!/bin/sh
echo '*************************'
env | fgrep DISPLAY
echo '*************************'
EOF
chmod 755 test.sh
# create a pom, which calls the above shell script
cat >pom.xml <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>freestyle</groupId>
<artifactId>sample</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>show-display</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>test.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
EOF
# download dependencies silently to not clutter the output below
mvn -B -q compile >/dev/null 2>&1
echo
echo Running shell, this shows the correct output:
mvn -B -q compile
echo
echo Now running Maven buildstep, this shows the wrong output:
-B -q compile
(Default)
false
Default
1024x768x24
false
0
1
false