I have a pom.xml file and in that i see that their are 3 dependencies referenced for same <artifactId>
the difference are in tags
<classifier>sources</classifier> <classifier>javadoc</classifier>
I have deleted the dependencies that had the SOURCES/JAVADOC
and only kept one dependency. I tested my application and every thing work fine.
What is the purpose of using this classifier tag? and why i need to duplicate dependencies twice for adding <classifier>
tag with SOURCES/JAVADOC
.
<dependency> <groupId>oauth.signpost</groupId> <artifactId>signpost-commonshttp4</artifactId> <version>1.2.1.2</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>oauth.signpost</groupId> <artifactId>signpost-commonshttp4</artifactId> <version>1.2.1.2</version> <type>jar</type> ***<classifier>javadoc</classifier>*** <scope>compile</scope> </dependency> <dependency> <groupId>oauth.signpost</groupId> <artifactId>signpost-commonshttp4</artifactId> <version>1.2.1.2</version> <type>jar</type> ***<classifier>sources</classifier>*** <scope>compile</scope> </dependency>
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.
In Maven, a dependency is just another archive—JAR, ZIP, and so on—which our current project needs in order to compile, build, test, and/or run. These project dependencies are collectively specified in the pom.
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.
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.
Source
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