springboot项目中查看spring版本和springBoot版本号

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringBootVersion;
import org.springframework.core.SpringVersion;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author ---
 * @date 3/6/2020
 */
@RunWith(SpringJUnit4ClassRunner.class)
public class UserTest {

    @Test
    public void Test1(){
        String version = SpringVersion.getVersion();
        String version1 = SpringBootVersion.getVersion();
    }
}

 

    原文作者:tengtianshan
    原文地址: https://blog.csdn.net/tengtianshan/article/details/115396817
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞