zoukankan      html  css  js  c++  java
  • 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包.

  • 相关阅读:
    cookie secure属性 导致setcookie失败-test
    vim 常用操作总结(持续更新)-test
    网页重定向(外部重定向和内部重定向)-test
    pat 1002 A+B for polynomials (第二个测试点一直无法通过,最后解决)-test
    pat 1001 A+B Format-test
    验证码无法显示的其中一种原因-test
    str_replace替换换行符失败原因-test
    .net/C#语言web项目内新增js或css文件调用不到,url报错404
    在W10系统中配置Java环境变量后,cmd命令提示符找不到java
    JS使用知识点理解
  • 原文地址:https://www.cnblogs.com/maria-ld/p/8146473.html
Copyright © 2011-2022 走看看