How do I change the dependency for Jersey Gradle projects?

I was trying to solve the MessageBodyWriter not found problems in the Jersey project I created. I have a lot of recommendations for fixing dependencies, some of which mention changing the pom.xml, but since the project I got was built and compiled in Gradle, this type does not exist. What are the similar files that I need to examine in terms of checking dependency?

0


source to share


2 answers


Maven -> Gradle == <groupId>:<artifactId>:<version>

So

<dependency>
  <groupId>org.glassfish.jersey.media</groupId>
  <artifactId>jersey-media-json-jackson</artifactId>
  <version>${jersey2.version}</version>
  <scope>runtime</scope>
</dependency>

      

in Gradle will be

compile org.glassfish.jersey.media:jersey-media-json-jackson:${jersey2.version}

      



${jersey2.version}

is whatever version you are using in Jersey 2.x.

See also:

Note. ... The above solution is if you get "MessageBodyReader and didn't find for app / json". Any other type, then you will need to show us the stack. I am just listing the most common one (and what you linked to) as you did not provide the exact stacktrace message. This may be valid for any type, in which case this answer would be irrelevant. You can also find this one . Just some general information about MessageBodyReaders and MessageBodyWriters

+2


source


Take the data you add to your pom and add it like this top build file ...

dependencies {
    compile group: 'org.hibernate', name: 'hibernate-core', version: '3.6.7.Final'
}

      



You can copy the text of your pom file exactly.

0


source







All Articles