解决maven项目没有Maven Dependencies

为了证明我还活着,今天就记录一下maven项目没有Maven Dependencies怎么解决

一 在pom.xml配置这段代码设置远程仓库(个人推荐阿里的远程仓库)

<repositories>
    <repository>
        <id>Dcm4Che</id>
        <name>Dcm4Che</name>
        <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

 

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
    </parent>
    <dependencies>
        <!-- -springboot 整合Web组件 整合SpringMVC 就会把传统方式的SpringMVC依赖的jar全部给下载来 -->
        <!-- 引入spring-boot-starter-web 帮你整合好所有相关的依赖jar包 原理 maven依赖传递 -->

        <!-- 原理: spring-boot-starter-parent< 中,整合号相关 jar依赖信息 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- -springboot 整合Web组件 整合SpringMVC 就会把传统方式的SpringMVC依赖的jar全部给下载来 -->
        <!-- 引入spring-boot-starter-web 帮你整合好所有相关的依赖jar包 原理 maven依赖传递 -->

        <!-- 原理: spring-boot-starter-parent< 中,整合号相关 jar依赖信息 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- 引入freeMarker的依赖包. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>
    </dependencies>

 

 

 

二 maven → update project(ok)

posted @ 2019-07-07 10:28  Money131  阅读(10143)  评论(0编辑  收藏  举报