springboot项目中classpath指向了哪里,以及如何获取springboot项目默认的的classpath

一、classpath指向了那里

1、用maven构建(build)项目时,默认的classpath指向target/classes/

2、用maven打包(package)项目时,默认的classpath指向war内部的WEB-INF/classes/

二、如果获取springboot项目默认的classpath

// 获取classpath
String classpath = ResourceUtils.getURL("classpath:").getPath();
原文地址:https://www.cnblogs.com/daihu/p/13851519.html