首页 > 其他 > 详细

maven如何引入本地依赖

时间:2014-05-07 04:15:41      阅读:489      评论:0      收藏:0      [点我收藏+]

今天遇到一个问题,要做一个语音识别接口的对接,想先跑一下对方给的demo,但是发现使用了maven却没有在pom里添加依赖,不知道他那边是怎么运行的。于是想到要在pom中添加本地依赖,结果真的可以:


System Dependencies

Dependencies with the scope system are always available and are not looked up in repository. They are usually used to tell Maven about dependencies which are provided by the JDK or the VM. Thus, system dependencies are especially useful for resolving dependencies on artifacts which are now provided by the JDK, but where available as separate downloads earlier. Typical example are the JDBC standard extensions or the Java Authentication and Authorization Service (JAAS).

A simple example would be:

<project>
...
<dependencies>
<dependency>
<groupId>javax.sql</groupId>
<artifactId>jdbc-stdext</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${java.home}/lib/rt.jar</systemPath>
</dependency>
</dependencies>
...
</project>
If your artifact is provided by the JDK‘s tools.jar the system path would be defined as follows:

<project>
...
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
...
</project>

ok,so easy!

maven如何引入本地依赖,布布扣,bubuko.com

maven如何引入本地依赖

原文:http://blog.csdn.net/newriver00/article/details/25026387

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!