您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

将Spring Boot集成到EAR项目中

将Spring Boot集成到EAR项目中

您必须使用依赖性管理系统。

它允许您将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

Java 2022/1/1 18:19:05 有424人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶