微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

原创作品,允许转载,转载时请务必以超链接形式标明文章  原始出处 、作者信息和本声明。否则将追究法律责任。 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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐