Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of possible classifiers and types in dependencies

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!

like image 845
Random Avatar asked May 25 '11 12:05

Random


People also ask

What is a dependency classifier?

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.

What is type in Maven dependency?

There are two types of dependencies in Maven: direct and transitive. Direct dependencies are the ones that we explicitly include in the project.

What are Maven classifiers?

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.

Which of the following tag is used to include dependency jar file details?

You can use the newly created jar using a <classifier> tag.


2 Answers

From the Maven Reference:

Update

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 are jar, ejb-client and test-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.

like image 69
Péter Török Avatar answered Oct 10 '22 00:10

Péter Török


  • 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

like image 38
abbas Avatar answered Oct 10 '22 01:10

abbas