zoukankan      html  css  js  c++  java
  • maven项目从本地向本地仓库导入jar包

    方法一(推荐):

    <dependency>
                <groupId>guagua-commons</groupId>
                <artifactId>guagua-commons</artifactId>
                <version>1.0.1</version>
                <scope>system</scope>
                <systemPath>${project.basedir}/lib/guagua-commons-1.0.1.jar</systemPath>
    </dependency>

    如上,将jar包guagua-commons-1.0.1.jar复制到项目根目录(和src目录同级)的lib文件夹下,加入<scope>system</scope>
    <systemPath>${project.basedir}/lib/jar包名称</systemPath>即可

    方法二:
    在maven安装目录下的bin目录中进入cmd,运行:  mvn install:install-file -Dfile=jar包的路径 -DgroupId=<groupId>中的内容 -DartifactId=<artifactId>标签中的内容 -Dversion=<version>的内容 -Dpackaging=jar     出现BUILD SUCCESS即成功,即可在项目中正常导入jar包。
      弊端:当项目跟换服务器时,需要重新以同样的操作将jar包导入到本地maven仓库。
    例子:mvn install:install-file -Dfile=F:messageguagua-commons-1.0.1.jar  -DgroupId=guagua-commons   -DartifactId=guagua-commons  -Dversion=1.0.1   -Dpackaging=jar     出现BUILD SUCCESS即成功;

    之后在项目中正常导入jar包即可:

    <dependency>
                <groupId>guagua-commons</groupId>
                <artifactId>guagua-commons</artifactId>
                <version>1.0.1</version>
    </dependency>
  • 相关阅读:
    总结Selenium自动化测试方法(二)测试环境搭建
    画画学习
    喜欢看的电影
    angular学习知识点
    前端编辑器
    托尔斯泰经典语录:没有风暴,船帆不过是一块破布
    当下最流行的10大H5前端框架
    移动端问题总纲
    第二阶段团队冲刺04
    第二阶段团队冲刺03
  • 原文地址:https://www.cnblogs.com/wanghj-15/p/12174990.html
Copyright © 2011-2022 走看看