Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of <type> tag within <dependency> tag?

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.

like image 480
gicig Avatar asked Oct 23 '25 16:10

gicig


1 Answers

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.

like image 163
chrylis -cautiouslyoptimistic- Avatar answered Oct 25 '25 05:10

chrylis -cautiouslyoptimistic-