我正在开始一个我想用 Eclipse 和 Maven 编译的项目。在命令行上一切正常,如果我删除 Maven 性质,项目在 Eclipse 中运行正常。但是启用 Maven 后,我在 POM 的第一行收到此错误
dependency=[com.actionbarsherlock:actionbarsherlock:apklib:4.2.0:compile]
not found in workspace
这是我完整的 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>com.foo.bar</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>test</name>
<properties>
<java.version>1.6</java.version>
<platform.version> 4.1.1.4</platform.version>
<android.platform>16</android.platform>
<android-support.version>r7</android-support.version>
<abs-version>4.2.0</abs-version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>${android-support.version}</version>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>${abs-version}</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>${android.platform}</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
我还注意到 Eclipse->Properties->Android->Library 没有指向 ABS 的链接
我在这个设置中缺少什么?