加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

依赖类型dependency type在maven中的作用

发布时间:2020-12-14 05:14:04 所属栏目:百科 来源:网络整理
导读:看看下面这段pom配置 ...dependency????groupIdxxx/groupId????artifactIdyyy/artifactId????typeejb/type/dependency... 这个type很多maven相关的资料中都未曾提及,而上网搜了一下中文资源,这些文章都把compile、runtime、test等本属于scope的概念混淆为

看看下面这段pom配置

...
<dependency>
????<groupId>xxx</groupId>
????<artifactId>yyy</artifactId>
????<type>ejb</type>
</dependency>
...

这个<type>很多maven相关的资料中都未曾提及,而上网搜了一下中文资源,这些文章都把compile、runtime、test等本属于scope的概念混淆为“依赖类型”<type>的概念。而且,关于这个<type>的解释也非常少。

我也是看了Maven 3 Cookbook之后从中找到些只言片语,反推出type的作用。

看书中原文(P134. How it works...):

Adding the type of apk to the dependency allows the Maven Android plugin to find the Android package of the application.

不难看出,<type>apk</type>告诉maven使用maven android plugin来进行处理<type>为apk的依赖。从而推想<type>ejb</type>就是告诉maven使用maven ejb plugin来处理。如果想知道ejb plugin如何处理这类dependency,那就去查查ejb plugin的详细说明吧,这个plugin的说明网上有很多。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读