Maven----将手动下载的jar包以命令行的方式安装到本地MavenRepository中

1.情景再现:准备实现SprintBoot的热部署功能,因没有对应jar时,在Eclipse中mvn install 会报错:

  报错信息:

[INFO] --- spring-boot-maven-plugin:1.4.1.RELEASE:run (default-cli) @ spring-boot ---
[WARNING] The POM for org.springframework:springloaded:jar:1.2.4RELEASE is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.328 s
[INFO] Finished at: 2017-12-29T21:31:02+08:00
[INFO] Final Memory: 13M/33M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.1.RELEASE:run (default-cli) on project spring-boot: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:1.4.1.RELEASE:run failed: Plugin org.springframework.boot:spring-boot-maven-plugin:1.4.1.RELEASE or one of its dependencies could not be resolved: Failure to find org.springframework:springloaded:jar:1.2.4RELEASE in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

2. 因Maven无法自动从网上仓库下载到相应的jar包,所以需要手动进行安装到本地MavenRepository中

  命令格式如下:

mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar

  参数一:Jar包所在的位置

  参数二:jar包的groupId

  参数三:jar包的artifactId

  参数四:jar包的版本号

3.实际操作:如下图

4. 特别注意事项:

  4.1 注意"-"不能缺少 install后面的"-"是没有空格的
  4.2 注意"-Dfile"中jar包的路径和jar包的名字.
  4.3 注意看cmd命令提示,查看本地repository中是否成功的复制了jar包.

 

转载于:https://www.cnblogs.com/maria-ld/p/8146473.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值