java - maven使用插件报错

 个性2402852463 发布于 2022-10-28 17:25
    
        
            
                
                    org.apache.maven.plugins
                    maven-site-plugin
                    3.0-bate-1
                
            
        
        springmaven
    

上面是插件信息,下面是当运行mvn site时包的错误,本地仓库中我已经看到有maven-site-plugin插件的jar包存在了。

[ERROR] Plugin org.apache.maven.plugins:maven-site-plugin:3.0-bate-1 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-site-plugin:jar:3.0-bate-1 in http://10.10.13.5:8081/artifactory/plugins-release 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

3 个回答
  • 更改了版本号就好了

    2022-10-29 22:58 回答
  • mvn命令后面加上-U就好了

    2022-10-29 23:00 回答
  • Maven默认会使用本地缓存的库来编译工程,对于上次下载失败的库,maven会在~/.m2/repository/ / / /目录下创建xxx.lastUpdated文件,一旦这个文件存在,那么在直到下一次nexus更新之前都不会更新这个依赖库。

    解决办法:

    删除~/.m2/repository/ / / /目录下的*.lastUpdated文件,然后再次运行mvn compile编译工程。

    另外也有说可以修改~/.m2/settings.xml文件,将其中的仓库添加
    <updatePolicy>always</updatePolicy>

    来强制每次都更新依赖库,但这个方法我还没有试过,这里先记下,下次再碰到这个问题的时候再试试。

    当然一定要确保你远程仓库有这个插件

    2022-10-29 23:06 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有