我已经更新到最新版本的ADT插件,我面对的是this issue,也解决了m2e-android eclipse插件的更新问题。现在,我可以通过控制台编译我的项目,但不能使用eclipse。这是eclipse中pom.xml
文件抛出的异常:
dependency=[com.actionbarsherlock:library:apklib:4.1.0:compile] not found in workspace
在以前的ADT/m2e-android版本中,我可以毫无问题地构建控制台和eclipse。
有人知道怎么解决这个问题吗?也许我的pom.xml错了?
耽误您时间,实在对不起。
当前正在使用:
pom.xml:
<?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.jelies</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.1_r2</version>
<scope>provided</scope>
</dependency>
<!-- some unrelated dependencies -->
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>library</artifactId>
<version>4.1.0</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
<emulator>
<avd>avd-4.1</avd>
</emulator>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>eclipse</id>
<activation>
<!-- This profile is only activated when m2e.version is present (only
in eclipse) -->
<property>
<name>m2e.version</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r7</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
编辑:
答案是正确的。在我的工作区中制作了ABS库项目,错误就消失了!但是,另一个问题出现了: ABS传递依赖被添加到我的项目中,导致eclipse无法启动应用程序。这是一个已知问题,您可以关注here。
发布于 2012-08-21 15:28:30
从Android 0.4.2开始,您现在需要在Eclipse工作区中修改Android库项目,以便m2e-android能够成功检测到它们。ActionBarSherlock的POM可以在以下位置找到:
https://github.com/JakeWharton/ActionBarSherlock/blob/master/library/pom.xml#
注意:安卓M2E-是测试版软件,因此可能会在不同版本之间发生影响功能的更改。
发布于 2013-10-26 04:31:24
对于那些不知道"MAVENIZED“是什么意思的人来说,它是将一个简单的项目转换成一个Maven项目。
在Eclipse中,右键单击您的项目,配置Maven Convert to -> project
发布于 2012-12-01 05:16:31
只有在通过配置文件使用eclipse时,才能将actionbarsherlock依赖项作为jar文件包含在内。
<profile>
<id>m2e</id>
<activation>
<property><name>m2e.version</name></property>
</activation>
<dependencies>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>${abs.version}</version>
<type>jar</type>
</dependency>
</dependencies>
</profile>
并且不需要将整个actionbarsherlock作为项目包含在eclipse中。
https://stackoverflow.com/questions/12043237
复制相似问题