麻甩君子丶
  • 5
  • 新人请关照

断网环境开发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,但试过没用

阅读 455
评论 2019-11-22 提问
    2 个回答
    麻甩君子丶
    • 5
    • 新人请关照

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

    评论 赞赏

      mvn install 就行了吧

      评论 赞赏
        撰写回答

        登录后参与交流、获取后续更新提醒