How to set GWT headless mode when testing only for Maven?

I am using Maven 3.0.3, GWT 2.4 for Linux. I want to set the headless GWT mode when running some tests (e.g. setting -Djava.awt.headless = true). My question is: how to set this parameter when running my GWT tests via Maven? I run my GWT tests by running

mvn clean test

Thanks - Dave

+5
source share
2 answers

You can pass configuration parameters through the surefire plugin. How:

<build>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.14</version>
  <configuration>
    <systemPropertyVariables>
      <java.awt.headless>true</java.awt.headless>
    </systemPropertyVariables>
  </configuration>
</plugin>
...

Link: http://maven.apache.org/surefire/maven-surefire-plugin/examples/system-properties.html

" ", :

<build>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.14</version>
  <configuration>
    <systemProperties>
      <java.awt.headless>true</java.awt.headless>
    </systemProperties>
  </configuration>
</plugin>
...

Surefire: http://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html

+4

, (, Hudson CruiseControl), .

(, - ). Xvfb - X- X-System System - ( ). , , , , . ( 100 maven)

:

, X- /, . Google "install x window", , Linux.

Xvfb

sudo apt-get install Xvfb
( Ubuntu Linux)
yum search Xvfb
( CentOS, , yum install...) lunux

xvfb.hosts , "localhost" "servername.yourcompany.com". -.

nohup Xvfb :99 -auth xvfb.hosts > xvfb.log &

( )

, :

export DISPLAY=:99

, , . DISPLAY CruiseControl Hudson.

, - GUI . , .

0

All Articles