Thomas Sundberg

October 6, 2011

Why isn’t my tests being executed?

Filed under: Automation, Maven, Programming — Tags: , , , , , , , , , , — Thomas Sundberg @ 17:19

This post has been migrated to

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

  • pom
  • jar
  • maven-plugin
  • ejb
  • war
  • ear
  • rar
  • par

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



Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: