简体   繁体   English

通过 Maven / Eclipse 导入 Spotify API 客户端库

[英]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我想使用此包装器通过 Eclipse IDE 使用 Java 访问 Spotify Web API: https : //github.com/thelinmichael/spotify-web-api-java

However, I have zero knowledge of Maven and working with external libraries.但是,我对 Maven 和使用外部库的知识为零。 I imported this project using "File > Import > Existing Maven Projects..." and that seemed to work fine.我使用“文件 > 导入 > 现有 Maven 项目...”导入了这个项目,这似乎工作正常。 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?我是否创建一个新的用户库并将 jar 文件放入其中? And if I do that, how does the Maven part of it work?如果我这样做,它的 Maven 部分是如何工作的?

Thanks so much.非常感谢。 I'm really struggling here.我真的在这里挣扎。

Just like any maven dependency, you simply add就像任何 maven 依赖项一样,您只需添加

<!-- 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.到您的 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 Maven 会在您构建时自动将 jars 导入您的.m2目录,您可以使用常规方式将它们导入我们的代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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