The same dependency is declared with no <type> and with <type>test-jar</test> in two different projects I am working on. However, I didn't manage to find a proper explanation of what it means.
Normally, test classes are not packaged into the jar; they're executed during the build and then only the main classes are exported.
However, there are some cases where you do want to export the test classes for some reason, and you can package them into a test-jar. An example of when you would do this is when you have integration tests (such as REST or Selenium) that require your application to be packaged up and deployed into a staging environment. Your CI server can deploy the jar and then get the test-jar and run the test classes from it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With