您必须使用依赖性管理系统。
它允许您将Spring Boot
WAR模块项目的父项设置为与
spring-boot-starter-parent。然后,可以像其他
WAR项目
EAR一样将项目包含到其中。
<dependencyManagement> <dependencies> <dependency> <!-- import dependency management from Spring Boot --> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>1.5.2.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies></dependencyManagement>
…现在您可以按通常方式使用所有Spring Boot启动器依赖项:
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency></dependencies>
您必须在模块项目级别指定启动程序依赖项,而依赖项管理配置可以在两个
EAR项目中都指定-围绕整个项目或在每个项目中分别指定,具体取决于应用程序的要求。
在没有父POM的情况下使用Spring Boot



