本文介绍了Mavens 依赖声明分类器属性的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 pom.xml 文件,我看到它们是为相同的 <artifactId> 引用的 3 个依赖项,不同之处在于标签

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>

我删除了具有 SOURCES/JAVADOC 的依赖项,只保留了一个依赖项.我测试了我的应用程序,一切正常.

I have deleted the dependencies that had the SOURCES/JAVADOCand only kept one dependency. I tested my application and every thing work fine.

使用这个分类器标签的目的是什么?以及为什么我需要复制依赖项两次才能添加 标签和 SOURCES/JAVADOC .

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>

推荐答案

来源

这篇关于Mavens 依赖声明分类器属性的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 07:26