如果是springboot项目,可以在pom文件中写成 org.springframework.boot spring-boot-maven-plugin exec ,将项目打成jar包,安装到maven仓库。就可以在项目中使用了。