首页 > 学院 > 开发设计 > 正文

下载jar包到本地仓库并且引入到maven中

2019-11-06 09:05:15
字体:
来源:转载
供稿:网友

手动将下载下来的 JAR 包添加到 Maven 的本地仓库。

一.下载jar包(下面推荐几个网址)

1.http://mvnrepository.com/

2.http://search.maven.org/

3.http://repository.sonatype.org/content/groups/public/

平常用第一个就够了,下面以第一个为例:

二.具体操作步骤

1.到 http://mvnrepository.com/ 这个网,在搜索栏中输入你要找的jar(比如:org.apache.poi.xwpf.converter.core),下面直接贴图:

2.选择jar版本(此处下载1.0.4)

3.下载jar并且复制依赖语句到项目的pom文件(依赖语句不可更改)

4.maven 安装jar包位置

mvn install:install-file -Dfile=jar包的位置 -DgroupId=上面的groupId -DartifactId=上面的artifactId -Dversion=上面的version -Dpackaging=jar例子:

mvn install:install-file -Dfile=D:/maven/apache-maven-3.0.4/repository/org/apache/poi/converter-core/1.0.4/org.apache.poi.xwpf.converter.core-1.0.4.jar -DgroupId=fr.opensagres.xdocreport -DartifactId=org.apache.poi.xwpf.converter.core -Dversion=1.0.4 -Dpackaging=jar

耐心之树,结黄金之果。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表