Android 添加诸如support-v4和appcompat-v7之类的依赖项
我正在尝试向android maven项目添加各种依赖项,特别是来自Android 添加诸如support-v4和appcompat-v7之类的依赖项,android,maven,maven-3,pom.xml,android-maven-plugin,Android,Maven,Maven 3,Pom.xml,Android Maven Plugin,我正在尝试向android maven项目添加各种依赖项,特别是来自build.gradle文件的依赖项: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services-cast:7.8.0' compile 'com.android.support:support-v4:23.0.1' compile '
build.gradle
文件的依赖项:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-cast:7.8.0'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:cardview-v7:22.0.0'
compile 'com.android.support:mediarouter-v7:22.0.0'
compile (name:'CastCompanionLibrary-debug', ext:'aar')
compile 'com.github.amlcurran.showcaseview:library:5.0.0'
compile 'com.chrisanderson.mediabrowsercompat:library:0.0.2'
}
我一直在尝试按照说明进行操作,其中告诉您使用以下内容设置本地存储库:
<repository>
<id>android-support</id>
<name>android-support</name>
<url>file://${env.ANDROID_HOME}/extras/android/m2repository</url>
</repository>
以下是我的完整pom:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xxx</groupId>
<artifactId>xxx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<properties>
<!-- at test time this will be overridden with snapshot version -->
<it-plugin.version>4.3.0</it-plugin.version>
</properties>
<repositories>
<repository>
<id>android-support</id>
<name>android-support</name>
<url>file://${env.ANDROID_HOME}/extras/android/m2repository</url>
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${it-plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>23</platform>
</sdk>
<manifest>
<debuggable>true</debuggable>
</manifest>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-v4</artifactId>
<version>23.0.1</version>
</dependency>
</dependencies>
</project>
4.0.0
xxx
xxx
0.0.1-快照
apk
4.3.0
android支持
android支持
文件://${env.ANDROID_HOME}/extras/ANDROID/m2repository
src
${project.artifactId}
com.simpligility.maven.plugins
安卓maven插件
${it plugin.version}
真的
com.simpligility.maven.plugins
安卓maven插件
23
真的
真的
com.google.android
安卓
4.1.1.4
假如
com.android.support
支持-v4
23.0.1
根据错误日志,${env.ANDROID_HOME}无法解析,您是否可以尝试硬编码路径并查看错误是否继续。我建议改用。它会将文件复制到本地Maven repo中,或将其部署到存储库管理器中。然后,您可以将它们声明为普通依赖项,而无需在设置或pom中进一步配置,请检查gradle更新
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xxx</groupId>
<artifactId>xxx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<properties>
<!-- at test time this will be overridden with snapshot version -->
<it-plugin.version>4.3.0</it-plugin.version>
</properties>
<repositories>
<repository>
<id>android-support</id>
<name>android-support</name>
<url>file://${env.ANDROID_HOME}/extras/android/m2repository</url>
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${it-plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>23</platform>
</sdk>
<manifest>
<debuggable>true</debuggable>
</manifest>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-v4</artifactId>
<version>23.0.1</version>
</dependency>
</dependencies>
</project>