如何在Android项目中导入一个Artifactory仓库(例如:worldwind)?

huangapple go评论63阅读模式
英文:

How to import an artifactory repository (ie: worldwind) inside an Android project?

问题

我按照文档导入WorldWind到我的项目中:

> repositories {
> maven {
> url 'https://oss.jfrog.org/artifactory/oss-snapshot-local'
> } }
>
> ...
>
> compile 'gov.nasa.worldwind.android:worldwind:0.9.0-SNAPSHOT'

但是它抛出了这个异常:

> Caused by:
> org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:
> Could not resolve all files for configuration
> ':app:debugCompileClasspath'.

这是我的settings.gradle文件:

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven{ url 'https://oss.jfrog.org/artifactory/oss-snapshot-local'}
    }
}
rootProject.name = "WorldWind"
include ':app'

以及我的build.gradle文件:

...

dependencies {
    implementation 'androidx.core:core-ktx:1.10.1'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    implementation 'gov.nasa.worldwind.android:worldwind:0.9.0-SNAPSHOT'
}

有任何想法是什么原因吗?

英文:

I followed the documentation to import WorldWind inside my project :

> repositories {
> maven {
> url 'https://oss.jfrog.org/artifactory/oss-snapshot-local'
> } }
>
> ...
>
> compile 'gov.nasa.worldwind.android:worldwind:0.9.0-SNAPSHOT'

However it throws me this exception :

> Caused by:
> org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:
> Could not resolve all files for configuration
> ':app:debugCompileClasspath'.

Here is my settings.gradle file :

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven{ url 'https://oss.jfrog.org/artifactory/oss-snapshot-local'}
    }
}
rootProject.name = "WorldWind"
include ':app'

And my build.gradle file :

...

dependencies {
    implementation 'androidx.core:core-ktx:1.10.1'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    implementation 'gov.nasa.worldwind.android:worldwind:0.9.0-SNAPSHOT'
}

Any idea where this comes from?

答案1

得分: 1

你可以从 jcenter() 获取 0.8.0 版本:

// settings.gradle
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
}

// app build.gradle
implementation("gov.nasa.worldwind.android:worldwind:0.8.0")

我认为该仓库已经被停用

英文:

You can get the 0.8.0 version from jcenter():

// settings.gradle
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
}

// app build.gradle
implementation("gov.nasa.worldwind.android:worldwind:0.8.0")

I think the repository has been discontinued.

huangapple
  • 本文由 发表于 2023年6月8日 19:33:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76431425.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定