List of possible classifiers and types in dependencies

℡╲_俬逩灬. 提交于 2019-12-22 04:14:36

问题


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!


回答1:


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.




回答2:


  • 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



来源:https://stackoverflow.com/questions/6124537/list-of-possible-classifiers-and-types-in-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!