简体   繁体   English

如何在Android中使用maven repo?

[英]how to use a maven repo in Android?

I am trying to extract dates from text in android and there is Java library here .我正在尝试从 android 中的文本中提取日期,这里有 Java 库。 However, the library needs a maven dependency as stated on the page:但是,该库需要页面上所述的 Maven 依赖项:

 <dependency>
        <groupId>net.rationalminds</groupId>
        <artifactId>DateParser</artifactId>
        <version>1.0</version>
 </dependency>

I have looked at other other answers and also modified build.gradle in my android project as follows, but I am still not able to use the library.我查看了其他其他答案,并在我的 android 项目中修改了build.gradle ,如下所示,但我仍然无法使用该库。 Can someone help me with the right usage of how to add dependencies?有人可以帮助我正确使用如何添加依赖项吗?

repositories {
    google()
    jcenter()
    mavenCentral()
}

maven repo can be used in grade, the difference is the format, add code below to your build.gradle maven repo 可以在grade中使用,不同的是格式,在你的build.gradle下面添加代码

dependencies {
    compile("net.rationalminds:DateParser:1.0")
}

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

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