Just follow http://maven.apache.org/guides/mini/guide-attached-tests.html.
It doesn't explain why you should use
instead of
but one reason I can think of is that by using the type tag, you reduce the possible confusion with using type of jar and classifier of tests.
Labels

2 Comments
Hide/Show CommentsJan 02, 2007
Bae
This may be because the pom.xml docs provide this information:
http://maven.apache.org/ref/2.0.4/maven-model/maven.html#class_dependency
type
The type of dependency. This defaults to jar. While it usually represents the extension on the filename of the dependency, that is not always the case. A type can be mapped to a different extension and a classifier. The type often correspongs to the packaging used, though this is also not always the case. Some examples are jar, war, ejb-client and test-jar. New types can be defined by plugins that set extensions to true, so this is not a complete list.
Jan 22, 2007
Jacob Robertson
That paragraph explains what the "type" is, but doesn't explain why it should be used in preference to "classifier" especially in the case where either will work.