maven 将jar包安装到本地仓库

解决pom.xml中的某些依赖无法正确下载相应的jar包,如中央仓库中没有的jar包可是实际项目却需要(如oracle的jdbc包由于版权原因,中央仓库没有)

 1.将jar包下载下来

 2.执行命令如下:(确定你的maven已经配置好环境变量了)

  mvn install:install-file -Dfile="下载好的jar包位置" -DgroupId=对应groupId中的内容 -DartifactId=对应artifactId中的内容 -Dversion=对应version中的内容 -Dpackaging=jar

<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>easypoi-web</artifactId>
<version>2.3.0.2</version>
</dependency>

例如我的完整命令为 mvn install:install-file -Dfile="C:\Users\22501\Downloads\easypoi-web-2.3.0.2.jar" -DgroupId=org.jeecgframework -DartifactId=easypoi-web -Dversion=2.3.0.2 -Dpackaging=jar
执行完成后在本地仓库中可以找到对应的jar

 注意:我已经设置过本地仓库地址了(settings.xml中的配置),没有指定本地仓库的话不知道能否成功!

猜你喜欢

转载自www.cnblogs.com/lijianchuan/p/12968565.html
今日推荐