码迷,mamicode.com
首页 > 其他好文 > 详细

maven如何引入本地依赖

时间:2014-05-07 04:16:42      阅读:407      评论:0      收藏:0      [点我收藏+]

标签:maven   java   path   

今天遇到一个问题,要做一个语音识别接口的对接,想先跑一下对方给的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如何引入本地依赖

标签:maven   java   path   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!