System Dependencies
博客专区 > Geek-S 的博客 > 博客详情
System Dependencies
Geek-S 发表于2年前
System Dependencies
  • 发表于 2年前
  • 阅读 43
  • 收藏 0
  • 点赞 1
  • 评论 0

新睿云服务器60天免费使用,快来体验!>>>   

摘要: 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>


  • 打赏
  • 点赞
  • 收藏
  • 分享
共有 人打赏支持
粉丝 11
博文 75
码字总数 17668
×
Geek-S
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: