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

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

看看下面这段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的说明网上有很多。

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

相关推荐