我已经处理了一天半,需要帮助来弄清楚为什么我仍然会遇到遗漏 Artifact 错误。
也许我遗漏了有关 maven 工作方式的一些基本知识,但我认为您需要拥有 android 部署程序,因为 android jar 不在 maven 上。部署者将这些 android 依赖项移动到您本地的 maven 存储库。我已按照自述文件中的说明进行操作 https://github.com/mosabua/maven-android-sdk-deployer
那么,为什么它不能下载 Etsy 的 jar,为什么它会提示支持 jar,而我已经通过 android sdk 部署程序从我的本地存储库中包含了它????
运行方式 -> Maven 清理 -> Maven 安装
[INFO] Building AklOutdoors 0.0.1-SNAPSHOT
[WARNING] The POM for com.android.support:support-v4:jar:19.0.+ is missing,
no dependency information available
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal on project Could not resolve dependencies
for project
The following artifacts could not be resolved:
com.etsy.android.grid:library:jar:1.0.4,
com.android.support:support-v4:jar:19.0.+: Failure to find
com.etsy.android.grid:library:jar:1.0.4 in
http://repo.maven.apache.org/maven2 was cached in the local repository,
在中央的更新间隔结束或强制更新之前,不会重新尝试解决
- 已安装 Maven。
- Maven Android SDK Deployer 安装成功。
- 已安装 SDK 管理器中的所有内容,包括 Android 支持库和 Android 支持存储库
- Android for Maven Eclipse 已安装,Maven Integration for Eclipse 已安装。
这是我的 pom.xml
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>AklOutdoors</groupId>
<artifactId>AklOutdoors</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.4.2_r3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>19.1.0</version>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v13</artifactId>
<version>19.1.0</version>
</dependency>
<dependency>
<groupId>com.etsy.android.grid</groupId>
<artifactId>library</artifactId>
<version>1.0.4</version>
<exclusions>
<exclusion>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v7</artifactId>
<version>LATEST</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v7</artifactId>
<version>LATEST</version>
<type>apklib</type>
</dependency>
</dependencies>
非常感谢您提供帮助并解释我做错了什么。
最佳答案
我意识到这是相当陈旧/迟到的,但对于任何遇到过这个问题并偶然发现这个问题的人(比如我),我相信这里的解决方案是 etsy lib 应该声明为 <type>aar</type>
在pom.xml
:
<dependency>
<groupId>com.etsy.android.grid</groupId>
<artifactId>library</artifactId>
<version>1.0.5</version>
<type>aar</type>
<exclusions>
<exclusion>
<artifactId>support-v4</artifactId>
<groupId>com.android.support</groupId>
</exclusion>
</exclusions>
</dependency>
关于java - Android maven 缺少 Artifact 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23414142/