断网环境开发spring boot报错

新手上路,请多包涵

断网环境开发spring boot报错

报错如下:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.springframework.boot:spring-boot-starter-parent:[unknown-version]: Failure to find org.springframework.boot:spring-boot-dependencies:pom:2.2.1.RELEASE in file://D:\mavenRepository was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ org.springframework.boot:spring-boot-starter-parent:[unknown-version], D:\mavenRepository\org\springframework\boot\spring-boot-starter-parent\2.2.1.RELEASE\spring-boot-starter-parent-2.2.1.RELEASE.pom, line 3, column 11
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.example:demo:0.0.1-SNAPSHOT (F:\代码\demo\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.springframework.boot:spring-boot-starter-parent:[unknown-version]: Failure to find org.springframework.boot:spring-boot-dependencies:pom:2.2.1.RELEASE in file://D:\mavenRepository was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ org.springframework.boot:spring-boot-starter-parent:[unknown-version], D:\mavenRepository\org\springframework\boot\spring-boot-strter-parent\2.2.1.RELEASE\spring-boot-starter-parent-2.2.1.RELEASE.pom, line 3, column 11 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

pom.xml:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.1.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

Maven的setting.xml:

<localRepository>D:\mavenRepository</localRepository>

<mirror>
    <mirrors>
        <id>central</id>
        <name>central</name>
        <!-- 将镜像地址设置为本地maven地址 -->
        <url>file://D:\mavenRepository</url>
        <mirrorOf>*</mirrorOf>
    </mirror>
<mirrors>

Eclipse配置:
20191122091023.png

包的具体存放地址:
20191122100525.png

看网上说要在eclipse下进行Maven - Update project,但试过没用

阅读 4.4k
2 个回答
✓ 已被采纳新手上路,请多包涵

配置都是对的,是我有些pom或jar没有存在,去将别人的maven库全部拉过来就可以了。

mvn install 就行了吧

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题