-1

I am creating a Java project that needs to use the TMDB API. I am wondering how to add this https://github.com/holgerbrandl/themoviedbapi TMDB wrapper as a jar file so I can add it as a dependency in my java project.

PhonyStark
  • 21
  • 2

1 Answers1

0

If you're building with maven, then you would add it to your project's pom.xml as a dependency:

<dependencies>
    <dependency>
        <groupId>info.movito</groupId>
        <artifactId>themoviedbapi</artifactId>
        <version>1.11-SNAPSHOT</version>
    </dependency>
...
</dependencies>

For the future, plugging a dependency name into https://mvnrepository.com will get you the form of declaration that you need - see https://mvnrepository.com/artifact/info.movito/themoviedbapi/1.9

James McPherson
  • 2,476
  • 1
  • 12
  • 16
  • When I add it to my pom.xml I get errors. The groupId, artifactId and version are highlighted in red. It says Dependency 'info.movito:themoviedbapi:1.11' not found – PhonyStark Oct 16 '20 at 00:46
  • That's probably because (1) the version maven will find by default is 1.9 (latest in Maven Central) and (2) you haven't got snapshots enabled in your pom. See https://stackoverflow.com/questions/5901378/what-exactly-is-a-maven-snapshot-and-why-do-we-need-it for more on snapshots. – James McPherson Oct 16 '20 at 00:49
  • ... or just remove the `...` from your pom for that dependency, and maven will get a stable version (probably better unless you *really* need the snapshot – James McPherson Oct 16 '20 at 00:50
  • I removed the `...` from the pom.xml file and its still giving me the same errors. This is my first time using maven, I'm new to this all this. – PhonyStark Oct 16 '20 at 23:07
  • If you can save all the output from mvn to a file and then publish it on a pastebin or github gist and provide the link, more help should be possible – James McPherson Oct 17 '20 at 01:41