如何修改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,去这个网站https://mvnrepository.com/search?q=spring-boot-starter,找到自己想要的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即可。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐