zoukankan      html  css  js  c++  java
  • Maven外部依赖

    我们使用Maven从中央库或者从本地库等获取所需要的jar文件,但有的项目文件即不在中央库又不在本地库,需要我们手动下载。

    外部依赖注入的两种方式:

    1. 通过install-file 的形式加入到本地库。 mvn install:install-file -Dfile=c:kaptcha-{version}.jar -DgroupId=com.google.code

      -DartifactId=kaptcha -Dversion={version} -Dpackaging=jar
    但这种方式,移植到其它地方后,又需要再次加入到另一电脑的本地库。

    ojdbc因为牵扯付费因此虽然在mvn上可以看到但是没法下载。
    mvn install:install-file -Dfile=D:Repositoryojdbc14-10.2.0.4.0.jar  -DartifactId=ojdbc14 -DgroupId=com.oracle -Dversion=10.2.0.4.0 -Dpackaging=jar


    2. 项目中外部依赖
      在src目录下创建lib文件夹,将jar文件放入其中。
      在pom.xml文件中添加以下数据:
      

    <dependency>
      <groupId>ojdbc</groupId>
      <artifactId>ojdbc</artifactId>
      <scope>system</scope>
      <version>6</version>
      <systemPath>${basedir}srclibojdbc-6.jar</systemPath>
    </dependency>

    保存后,数据会自动进入到Maven Dependency中。



  • 相关阅读:
    AESUtil_1
    ELK配置
    Centos7上安装docker
    Excel大批量数据导出
    Redis5.0.6安装完整步骤
    idea远程打断点
    [HNOI2016] 序列
    [TJOI2017] 异或和
    洛谷 P4933 大师
    洛谷 P1950 长方形_NOI导刊2009提高(2)
  • 原文地址:https://www.cnblogs.com/DennyZhao/p/7699528.html
Copyright © 2011-2022 走看看