I just did it yesterday :)
Here's what I had to add into my pom.xml
Some versions
<fest-android.version>1.0.7</fest-android.version>
<robolectric.version>2.2</robolectric.version>
<junit.version>4.8.2</junit.version>
<android.test.version>4.2.2_r2</android.test.version>
Some dependencies
<!-- Test Dependencies -->
<dependency>
<groupId>com.squareup</groupId>
<artifactId>fest-android</artifactId>
<version>${fest-android.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>${robolectric.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>${android.test.version}</version>
<scope>provided</scope>
</dependency>
Obviously if you don't use fest-android, you don't need the version and dependency in your pom.
Surefire in the build tag
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<argLine>-Xmx1024m</argLine>
</configuration>
</plugin>
Point to your tests folder
By default, surefire looks for tests classes in /src/test/java , however if you changed that, configure the test folder just before the ending build tag as:
<testSourceDirectory>test</testSourceDirectory>
Done !
Cheers.