SherryLang / javalearning

while(Java){ learn !! }
3 stars 1 forks source link

SpringBoot学习记录 #8

Closed SherryLang closed 7 years ago

SherryLang commented 7 years ago

SpringBoot构建项目

step-by-step教程:Spring Boot 菜鸟教程 1 HelloWorld

  1. 报错:the import *** cannot be resolved (1)maven从远程(中央仓库)下载依赖包失败,需要修改settings.xml文件的依赖路径为镜像路径:
    <profiles>
    <profile>
    <id>develop</id>
    <repositories>
      <repository>
      <id>镜像路径id</id>
      <name>镜像路径名称</name>
      <url>http://你的镜像路径</url>
      ...
        </repository>
     </repositories>
    </profile>
    </profiles>

    (2)在pom.xml中导入依赖包

    <dependencies>
        <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependencies/>