gpt4 book ai didi

java - 如何将maven导入到我的Android Studio项目中?

转载 作者:行者123 更新时间:2023-12-01 21:49:27 26 4
gpt4 key购买 nike

我想在我的 Android 应用程序中使用一个库:ez Vcard 。然而这个库使用了我不熟悉的Maven。我在线检查,我的导入项目反对不提供 pom.xml soo,我该如何添加依赖项

<dependency>
<groupId>com.googlecode.ez-vcard</groupId>
<artifactId>ez-vcard</artifactId>
<version>0.9.9</version>
</dependency>

进入我的项目,具体在哪里?

最佳答案

你不需要maven项目,你可以在gradle项目中使用maven依赖项,你只需要使用依赖项的gradle格式。

此库似乎托管在 Maven Central 上,因此您必须在全局 build.gradle 中链接到此存储库主机:

allprojects {
repositories {
mavenCentral()
}
}

要将此依赖项导入到您的项目中,请在模块本地 build.gradle 文件中输入以下行:

dependencies {
compile 'com.googlecode.ez-vcard:ez-vcard:0.9.9'
// all the other dependencies...
}

你实际上可以看到here所有不同的依赖格式(在“依赖信息”下),从 maven 到 gradle、ivy、sbt 等,它们都与存储库兼容。

关于java - 如何将maven导入到我的Android Studio项目中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35405828/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com