Running maven tests without including them in output jar

I've got an IntelliJ Maven project set up with some tests in a separate 'tests' folder, which is marked as a tests source folder in IntelliJ. I've got a TC build setup with the Maven goals 'compile test package'. It looks like the tests aren't being included in the output jar (which is correct), but aren't being run.

What's the best way of not including the tests in the output jar, but still running them as part of a build by Maven?

1 comment
Comment actions Permalink


Please refer to Maven doumentation. In this section can find info on customization of directory structure. As Maven knows nothing about Idea project settings, you will need to add your 'tests' directory to maven layout.


Please sign in to leave a comment.