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

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

发布时间:2020-12-14 05:09:59 所属栏目:百科 来源:网络整理
导读:原创作品,允许转载,转载时请务必以超链接形式标明文章? 原始出处?、作者信息和本声明。否则将追究法律责任。 http://www.voidcn.com/article/p-knidesis-np.html 看看下面这段pom配置 1 2 3 4 5 6 7 ... dependency ???? groupId xxx/ artifactId yyy/ typ

原创作品,允许转载,转载时请务必以超链接形式标明文章? 原始出处?、作者信息和本声明。否则将追究法律责任。 http://www.voidcn.com/article/p-knidesis-np.html

看看下面这段pom配置

1
2
3
4
5
6
7
...
< dependency >
???? groupId >xxx</ >
artifactId >yyy</ >
type >ejb</ >
</ >
...

这个<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的说明网上有很多。


本文出自 “BitterJava” 博客,请务必保留此出处http://www.voidcn.com/article/p-knidesis-np.html



原文地址:http://www.voidcn.com/article/p-knidesis-np.html

(编辑:李大同)

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

    推荐文章
      热点阅读