依赖类型 ejb 和 ejb-client 之间有什么区别

Chr*_*311 5 dependencies pom.xml maven

如果您在 pom.xml 中包含依赖项,有什么区别

<dependency>
    <groupId>group.Id</groupId>
    <artifactId>artifact.Id</artifactId>
    <type>ejb-client</type>
    <scope>runtime</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

相对

<dependency>
    <groupId>group.Id</groupId>
    <artifactId>artifact.Id</artifactId>
    <type>ejb</type>
    <scope>runtime</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

小智 6

ejb类型是指包含ejb接口和实现、配置文件等的jar文件。

ejb-client 类型是指仅包含 ejb 接口类的 jar 文件。IE。仅包含 ejb 客户端调用它所需的内容。

maven-ejb-plugin 在其配置中具有默认或自定义配置,允许从客户端排除 EJB 实现类。