方式1:dependency 本地jar包

    <dependency>
<groupId>com.hope.cloud</groupId> <!--自定义-->
<artifactId>cloud</artifactId> <!--自定义-->
<version>1.0</version> <!--自定义-->
<scope>system</scope> <!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>${basedir}/lib/cloud.jar</systemPath> <!--项目根目录下的lib文件夹下-->
</dependency>

方式2:编译阶段指定外部lib

     <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>lib</extdirs><!--指定外部lib-->
</compilerArguments>
</configuration>
</plugin>

方式3:将外部jar打入本地maven仓库

cmd 进入jar包所在路径,执行以下命令

    mvn install:install-file -Dfile=cloud.jar -DgroupId=com.hope.cloud -DartifactId=cloud -Dversion=1.0 -Dpackaging=jar

引入依赖

    <dependency>
<groupId>com.hope.cloud</groupId>
<artifactId>cloud</artifactId>
<version>1.0</version>
</dependency>

maven项目引入外部jar包的更多相关文章

  1. maven项目引入外部jar包的三种方式

    方式1:dependency 本地jar包 <dependency> <groupId>com.hope.cloud</groupId> <!--自定义--& ...

  2. maven项目引用外部jar包的方法

    问题描述: 有一个java maven web项目,需要引入一个第三方包gdal.jar,但是这个包是自己打包的,在maven中央库里面找不到该包,因此我采用传统的方式,将这个包拷贝到:项目名称\sr ...

  3. (转)通过maven,给没有pom文件的jar包生成pom文件,maven项目引入本地jar包

    文章完全转载自 : https://blog.csdn.net/qq_31289187/article/details/81117478 问题一: 经常遇到公司私服或者中央仓库没有的jar包,然后通过 ...

  4. maven工程引入外部jar包

    pom.xml: <dependency> <groupId>new</groupId> <artifactId>new</artifactId& ...

  5. maven 引入外部jar包的几种方式(转)

    原文链接: maven 引入外部jar包的几种方式 方式1:dependency 本地jar包 <dependency> <groupId>com.hope.cloud< ...

  6. maven pom 引入本地jar包

    maven pom 引入本地jar包 在pom.xml同级目录下新建lib文件夹,并放入本地jar包. 配置Jar包的dependency,包括groupId,artifactId,version三个 ...

  7. Intellij IDEA 中如何查看maven项目中所有jar包的依赖关系图(转载)

    Intellij IDEA 中如何查看maven项目中所有jar包的依赖关系图 2017年04月05日 10:53:13 李学凯 阅读数:104997更多 所属专栏: Intellij Idea   ...

  8. Intellij IDEA 中如何查看maven项目中所有jar包的依赖关系图

    Maven 组件界面介绍 如上图标注 1 所示,为常用的 Maven 工具栏,其中最常用的有: 第一个按钮:Reimport All Maven Projects 表示根据 pom.xml 重新载入项 ...

  9. spring-boot打包,引入外部jar包问题

    这是我引入的外部jar包,打包的时候找不到外部jar包路径 弄了好久 在lib下引入外部jar包,运行没问题,但是打包是出现问题了,具体解决办法 再pom中加入如下配置,告诉maven导入本地jar ...

随机推荐

  1. BaseDao+万能方法 , HibernateDaoSupport

    package dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStat ...

  2. 2019CVPR:Classification-Reconstruction Learning for Open-Set Recogition(Abstract)

    Abstract Open-set classification is a problem of handling 'unknown' classes that are not contained i ...

  3. React-Native传值方式之 :DeviceEventEmitter添加监听控制并传值到其他页面

    在 native 开发中,我们可以使用广播实现事件的订阅和事件的触发,从而实现不在该页面但是可以调用该页面的方法. 在 React Native 中,我们也可以使用 DeviceEventEmitte ...

  4. 【AMAD】tenacity -- Python中一个专门用来retry的库

    动机 简介 用法 基本用法 何时停止 尝试间的等待 何时retry 其它 热度分析 源码分析 个人评分 动机 很多时候,我们都喜欢为代码加入retry功能.比如oauth验证,有时候网络不太灵,我们希 ...

  5. Kali Linux 2019.2使用华为源

    一.将默认的配置源注释掉 root@zinuo:~# vim /etc/apt/sources.list 注释: #deb http://http.kali.org/kali kali-rolling ...

  6. Oracle 看出表结构与属性、表空间设计

    1.Oracle 查看表空间 SELECT b.comments as 注释, a.column_name as 列名, a.data_type || '(' || a.data_length || ...

  7. jvm 调优工具 i

    https://blog.csdn.net/wait_notify/article/details/70268194 https://blog.csdn.net/a718515028/article/ ...

  8. 使用javascript完成一个简单工厂设计模式。

    在JS中创建对象会习惯的使用new关键字和类构造函数(也是可以用对象字面量). 工厂模式就是一种有助于消除两个类依赖性的模式. 工厂模式分为简单工厂模式和复杂工厂模式,这篇主要讲简单工厂模式. 简单工 ...

  9. CF235A 【LCM Challenge】

    这题好毒瘤啊 (特别是long long的坑,调了半天没调好!!)先将你特判一下小于3的话直接输出就是惹,不是的话就判断一下它能不能被2整除如果不能就直接输出n*(n-1)*(n-2)否则进行枚举枚举 ...

  10. HDU 4253-Two Famous Companies(二分+最小生成树)

    Description In China, there are two companies offering the Internet service for the people from all ...