[ACCEPTED]-Running JUnit tests with Maven under Eclipse-junit

Accepted answer
Score: 17

you can run Junit 4 with Maven. You just 4 need the Junit 4 dependency in your pom. You 3 also need the surefire plugin to execute 2 the tests.

See: http://maven.apache.org/plugins/maven-surefire-plugin/

Hint: By default surefire 1 looks for files with *Test.java naming to find tests.

Score: 3

Add this to your pom.xml

<project>
  [...]
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  [...]
</project>

run maven with clean test

0

More Related questions