Why isn’t my tests being executed?

Filed under: Java, Maven, — Tags: ear, ejb, par, pom, rar, test execution, war — Thomas Sundberg — 2011-10-06

Have you ever wondered why your Maven project doesn't find and execute your tests?

A common reason is that you have set your packaging type to 'pom'. That is, the module you are trying to build is some kind of aggregating or parent module. The problem(?) you have found is that the life cycle for Maven doesn't include executing the tests if the module has packaging set to 'pom'. This is by design so I'm not sure that it should be seen as a problem. It is however very irritating and annoying before you find the problem.

Change the package type to jar, war, ear or whatever type you need. The complete list is

And remember that not everyone of these packaging types will execute your tests.

For a complete list of Mavens lifecycles, take a look in the manual: Maven Lifecycles

Resources



(less...)

Pages

About
Events
Why

Categories

Agile
Automation
BDD
Clean code
Continuous delivery
Continuous deployment
Continuous integration
Cucumber
Culture
Design
Executable specification
Gradle
Guice
J2EE
JUnit
Java
Linux
Load testing
Maven
Mockito
Pair programming
PicoContainer
Presentation
Programming
Public speaking
Quality
Recruiting
Requirements
Scala
Selenium
Software craftsmanship
Software development
Spring
TDD
Teaching
Technical debt
Test automation
Tools
Web
Windows
eXtreme Programming

Authors

Thomas Sundberg
Adrian Bolboaca

Archives

Meta

rss RSS