0

I am developing a guice-jersey project from scratch. Following is the maven configuration in Parent :

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.glassfish.jersey</groupId>
                <artifactId>jersey-bom</artifactId>
                <version>${jersey.bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice-bom</artifactId>
                <version>${guice.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>${war.build.version}</version>
            </plugin>
        </plugins>
    </build>

    <dependencies>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>

    </dependencies>

Child pom file says the following dependencies are missing :

<dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-guice</artifactId>
        </dependency>

<dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-grizzly2</artifactId>
            <scope>test</scope>
        </dependency>

I see that both the dependencies are available in effective pom. How can i get ride of this issue. I have referred few projects are on github but none of them seems to have just the guice-jersey integrations. If there is any kindly direct me to that link.

Raghuveer
  • 2,859
  • 7
  • 34
  • 66
  • 1
    `org.glassfish.jersey` and `com.sun.jersey` are two completely different and incompatible versions of Jersey. The former is 2/3.x while the latter is 1.x. You need to use dependency with the `org.glassfish.jersey.x` groupId. – Paul Samsotha May 06 '21 at 22:25
  • thanks, it worked, but still my issue is i want a fully working jersey and guice integration sample project. Can you please direct me to any such link if you come across thanks. – Raghuveer May 07 '21 at 13:47
  • [It's pretty easy to configure](https://stackoverflow.com/a/32458999/2587435) – Paul Samsotha May 08 '21 at 06:12

0 Answers0