eclipse-ee4j / jersey

Eclipse Jersey Project - Read our Wiki:
https://github.com/eclipse-ee4j/jersey/wiki
Other
692 stars 354 forks source link

Simplified JAX-RS dependency #3914

Open mkarg opened 6 years ago

mkarg commented 6 years ago

Abstract

No need to explicitly add dependencies for JSON and SSE in application pom.xml.

Justification

Since JAX-RS 2.1, JSON and SSE support is mandatory. It is rather tedious to explicitly add dependencies to JSON and SSE support.

Proposed Solution

Publishing an importable pom ("full bom") which builds ontop of the existing bom, but includes JSON and SSE be default.

mkarg commented 6 years ago

@c-kunz FYI

jansupol commented 6 years ago

Looking at Jersey bom, it contains:

       <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-sse</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson1</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jettison</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-processing</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-binding</artifactId>
            <version>${project.version}</version>
        </dependency>

What do you mean by "include" JSON and SSE?

mkarg commented 6 years ago

Importing the BOM doesn't exactly enable Jersey, but it only declares potential dependencies. So the application programmer has to explicitly specify which HTTP backend he wants, which injection manager, whether he wants a client, whether he wants JSON and SSE.

My idea is that we provide a simplified BOM (and alternative one) which sits ontop of the BOM and which directly adds real dependencies (not just potential ones) for Client, JSON, SSE, CDI, and Grizzly. So people who do not want to pick from our LEGOs can have a JAX-RS implementation using one single dependency.