我遇到了以下问题。有时我想在我的 Android 项目中添加对 apklib 的依赖项,但是如果这个库有自己的依赖项,而这些依赖项没有在它自己的 pom 文件中声明,我会收到错误消息。
例如
<dependency>
<groupId>com.google.maps.android</groupId>
<artifactId>android-maps-utils-apklib</artifactId>
<version>0.3</version>
<type>apklib</type>
</dependency>
确实需要在依赖项之后进行正确的工作
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.4.2_r2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>19.0.1</version>
</dependency>
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>google-play-services</artifactId>
<version>14.0.0</version>
</dependency>
缺少的android-maps-utils-apklib-0.3.pom
因此,在我添加android-maps-utils-apklib
依赖项之后,IDE 告诉我这个 apklib 需要自己的依赖项(例如,已经添加到根项目的 android 核心)。
这意味着我有自己的项目(PROJ),它有一些 adpklib 依赖项(D),其中 D 需要一些库 D1、D2、D3。它们没有在 D 的 pom 文件中声明,但它们在 pom 中为 PROJ 声明,但没有帮助。
所以问题是如何为 D 添加缺少的依赖项?