今天从github上下下来代码到本地,本来想用终端进行mvn compile,但是一直报错。还以为是代码有问题,就删除之后重新clone了一遍,但是发现还是有错误。如何在IDEA中删除项目请参考: juejin.cn/post/684490… 报错信息如下:
E:\IdeaProjects\run-a-mvn-command>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building run-a-mvn-command 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.github.hcsp:test-plugin:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.512 s
[INFO] Finished at: 2019-09-29T13:44:59+08:00
[INFO] Final Memory: 7M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin com.github.hcsp:test-plugin:1.0-SNAPSHOT or one of its dependencies could not be resolved: Failure to find com.github.hcsp:test-plugin:jar:1.0-SNAPSHOT in http://10.1.15.172:8080/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of LocalMirrorId ha s elapsed or updates are forced -> [Help 1]
无法解决插件com.github.hcsp:test-plugin:1.0-SNAPSHOT或其依赖项之一:无法在http://10.1.15.172中找到com.github.hcsp:test-plugin:jar:1.0-SNAPSHOT :8080 / nexus / content / groups / public已缓存在本地存储库中,直到经过LocalMirrorId的更新间隔或强制执行更新后,才会重新尝试解析
[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] cwiki.apache.org/confluence/…
解决方法如下:!!!
发现是jar包有问题!!! 1.去mavnen项目默认jar包存放路径下看是否有jar包,发现jar包不存在。
注:从Maven中心仓库下载到本地的jar包的默认路径是:”{user.home}/.m2/repository”,{user.home}表示当前登录系统的用户目录(如"C:\Users\gacl")
2.可以使用Everything软件查找该jar包 1.0-SNAPSHOT.jar,在如图所示的路径下找到该jar包,直接将jar包拷到C盘的默认路径下即可。

3.如果Everything查找不到jar包,建议去下载jar包。