I have searched the net for the all the possible values that you can put in the scope tag inside dependency tag, but I haven't found any list with the same data for the classiffier and the type.
Anybody knows what I can and cannot put inside this tags?
Just to be clear, I am not asking what does the classifier tag or the type tag do, I just want a list of the data that this tag accepts or where can I find it.
Thanks!
The classifier distinguishes artifacts that were built from the same POM but differ in content. It is some optional and arbitrary string that - if present - is appended to the artifact name just after the version number.
There are two types of dependencies in Maven: direct and transitive. Direct dependencies are the ones that we explicitly include in the project.
A Maven artifact classifier is an optional and arbitrary string that gets appended to the generated artifact's name just after its version number. It distinguishes the artifacts built from the same POM but differing in content.
You can use the newly created jar using a <classifier> tag.
From the Maven Reference:
Oops, I misunderstood the question. Here is my second shot (important parts italicized by me):
The classifier allows to distinguish artifacts that were built from the same POM but differ in their content. It is some optional and arbitrary string that - if present - is appended to the artifact name just after the version number.
To me this suggests that you can use any classifier you want - it is not limited to a certain set of possible values.
type: Corresponds to the dependant artifact's packaging type. 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 corresponds to the packaging used, though this is also not always the case. Some examples arejar
,ejb-client
andtest-jar
. New types can be defined by plugins that set extensions to true, so this is not a complete list.
Which again tells, that although usually you won't find anything else in this property as the well known packaging types, the list of possible values is open and plugin-specific.
Default possible values for type
pom, jar, maven-plugin, ebb, war, ear, rar, java-source, javadoc, ejb-client, test-jar
Default possible values for classifier
sources, javadoc, client, tests
https://maven.apache.org/ref/current/maven-core/artifact-handlers.html
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