简体   繁体   中英

Importing Spotify API Client Library through Maven / Eclipse

I want to use this wrapper to access the Spotify Web API using Java, via an Eclipse IDE : https://github.com/thelinmichael/spotify-web-api-java

However, I have zero knowledge of Maven and working with external libraries. I imported this project using "File > Import > Existing Maven Projects..." and that seemed to work fine. However, I am not sure how to actually use the library / project in my code. Do I make a new user library and put the jar files into it? And if I do that, how does the Maven part of it work?

Thanks so much. I'm really struggling here.

Just like any maven dependency, you simply add

<!-- https://mvnrepository.com/artifact/se.michaelthelin.spotify/spotify-web-api-java -->
<dependency>
    <groupId>se.michaelthelin.spotify</groupId>
    <artifactId>spotify-web-api-java</artifactId>
    <version>6.4.0</version>
</dependency>

to your dependencies in your pom.xml. Maven will automatically import the jars into your .m2 directory when you build, and you can use import them into our code the regular way

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM