如何修改springboot的版本

如何修改springboot的版本

在使用idea创建springboot项目时,因为idea只能选择一些新版本的springboot,那么我们怎么才能创建其他版本呢? 1,随便创建一个版本。 2,把pom.xml里面的starter依赖注释掉。

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

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

3,去这个网站,找到自己想要的spring-boot-starter版本,复制下来,替换到父版本下。

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

4,打开starter注释,加载maven即可。

经验分享 程序员 微信小程序 职场和发展