title: Trying to get ScalaTest working: "There are no tests to run" when doing "mvn test"
body: <p>Edit: I finally got it to work!!!</p>
  
  <p>It needed a combination of JUnit in the pom.xml, and three statements in my .scala:</p>
  
  <pre><code>import org.junit.runner.RunWith
  import org.scalatest.junit.JUnitRunner
  
  @RunWith(classOf[JUnitRunner])
  </code></pre>
  
  <p>For some reason, trying to configure Surefire makes the tests stop running again.</p>
  
  <hr>
  
  <p>I'm coding in IntelliJ, trying to get a simple ScalaTest test running via a Maven (<code>mvn test</code>) build process. There aren't any errors, but unfortunately no tests run either.</p>
  
  <p>Here is my .scala file:</p>
  
  <pre><code>import org.scalatest.FunSuite
  import org.scalatest.BeforeAndAfter
  
  class ExampleSuite extends FunSuite with BeforeAndAfter {
  
    before {
      println("Doing setup tasks...")
    }
  
    test("Example test of checking the browser title") {
  
      val expected_title = "Company Platform"
      var actual_title = "Company Platform"
      assert(actual_title == expected_title)
    }
  
    after {
      println("Doing teardown tasks...")
    }
  }
  </code></pre>
  
  <p>Here's the Maven output:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [WARNING] 
  [WARNING] Some problems were encountered while building the effective model for JoeTestDemo:JoeTestDemo:jar:1.0
  [WARNING] 'build.plugins.plugin.version' for org.scala-tools:maven-scala-plugin is missing. @ line 42, column 21
  [WARNING] 
  [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
  [WARNING] 
  [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
  [WARNING] 
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building JoeTestDemo 1.0
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ JoeTestDemo ---
  [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] Copying 0 resource
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ JoeTestDemo ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO] 
  [INFO] --- maven-scala-plugin:2.15.2:compile (default) @ JoeTestDemo ---
  [INFO] Checking for multiple versions of scala
  [INFO] includes = [**/*.scala,**/*.java,]
  [INFO] excludes = []
  [WARNING] No source files found.
  [INFO] 
  [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ JoeTestDemo ---
  [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] skip non existing resourceDirectory /Users/Joeshaver/Projects/JoeTestDemo/src/test/resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ JoeTestDemo ---
  [INFO] No sources to compile
  [INFO] 
  [INFO] --- maven-scala-plugin:2.15.2:testCompile (default) @ JoeTestDemo ---
  [INFO] Checking for multiple versions of scala
  [INFO] includes = [**/*.scala,**/*.java,]
  [INFO] excludes = []
  [INFO] Nothing to compile - all classes are up to date
  [INFO] 
  [INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ JoeTestDemo ---
  [INFO] Surefire report directory: /Users/Joeshaver/Projects/JoeTestDemo/target/surefire-reports
  
  -------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  There are no tests to run.
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1.368s
  [INFO] Finished at: Tue Oct 23 10:58:30 PDT 2012
  [INFO] Final Memory: 6M/81M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Here is the pom.xml. I think my Maven Scala plugin might not be right:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;JoeTestDemo&lt;/groupId&gt;
      &lt;artifactId&gt;JoeTestDemo&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;scala-tools.org&lt;/id&gt;
              &lt;name&gt;Scala-tools Maven2 Repository&lt;/name&gt;
              &lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;scala-tools.org&lt;/id&gt;
              &lt;name&gt;Scala-tools Maven2 Repository&lt;/name&gt;
              &lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
              &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
              &lt;version&gt;2.9.0-1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.scalatest&lt;/groupId&gt;
              &lt;artifactId&gt;scalatest_2.9.0-1&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.scala-tools&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-scala-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                              &lt;goal&gt;testCompile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;sourceDir&gt;src/main/java&lt;/sourceDir&gt;
                      &lt;jvmArgs&gt;
                          &lt;jvmArg&gt;-Xms64m&lt;/jvmArg&gt;
                          &lt;jvmArg&gt;-Xmx1024m&lt;/jvmArg&gt;
                      &lt;/jvmArgs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>