springboot项目中怎样查看spring版本和springBoot版本号
如下:
java代码直接获取。
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();
}
}
* 1
* 2
* 3
* 4
* 5
* 6
* 7
* 8
* 9
* 10
* 11
* 12
* 13
* 14
* 15
* 16
* 17
* 18
* 19
* 20
- 有问题?
- 联系QQ:2946116934
0 评论