ActionBarSherlock + maven + eclipse:在工作空间中找不到依赖关系 [英] ActionBarSherlock + maven + eclipse: dependency not found in workspace

查看:296
本文介绍了ActionBarSherlock + maven + eclipse:在工作空间中找不到依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经更新到最新版本的ADT插件,我面临着这个问题,解决了更新还有m2e-android eclipse插入。现在,我可以通过控制台编译我的项目,但不能使用eclipse。这是eclipse中由 pom.xml 文件抛出的异常:



dependency = [ com.actionbarsherlock:library:apklib:4.1.0:compile]在工作区中找不到



在以前的ADT / m2e-android版本中,我能够建立控制台和日食没有问题。



有谁知道如何解决这个问题?可能我的pom.xml是错误的?



感谢您的时间。






目前使用:




  • Eclipse经典3.7.2(使用Juno问题仍然存在)

  • ADT 20.0.3

  • m2e-android 0.42

  • android-maven-plugin 3.3.0

  • maven 3.0.4

  • m2e 1.1.0(作为m2e-android 0.42中的依赖项)



pom.xml:

 <?xml version =1.0encoding =UTF- 8\" >?; 
< project xmlns =http://maven.apache.org/POM/4.0.0xmlns: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>

<依赖关系>
<依赖关系>
< groupId> android< / groupId>
< artifactId> android< / artifactId>
< version> 4.1_r2< / version>
< scope>已提供< / scope>
< / dependency>

<! - 一些不相关的依赖关系 - >

<依赖关系>
< groupId> com.actionbarsherlock< / groupId>
< artifactId>库< / 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>
<执行>
< 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>

<个人资料>
<个人资料>
< id> eclipse< / id>
< activate>
<! - 仅当m2e.version存在时才激活此配置文件(eclipse中仅
) - >
< property>
< name> m2e.version< / name>
< / property>
< / activation>
<依赖关系>
<依赖关系>
< groupId> com.google.android< / groupId>
< artifactId> support-v4< / artifactId>
< version> r7< / version>
< scope>已提供< / scope>
< / dependency>
< / dependencies>
< / profile>
< / profiles>
< / project>

编辑:



答案是对的。在我的工作区中放置了ABS库项目,错误消失了!但是,出现了另一个问题:将ABS传递依赖项添加到我的项目中,导致eclipse无法启动应用程序。这是一个已知的问题,您可以遵循此处

解决方案

从Android 0.4.2开始,您现在需要将m2e-android的Eclipse工作空间中的Android库项目映射成功检测他们ActionBarSherlock的POM可以在这里找到:



https://github.com/JakeWharton/ActionBarSherlock/blob/master/library/pom.xml#



注意: m2e-android是beta软件,因此可能会影响功能的更改可能发生在版本之间。


I've updated to lastest version of ADT Plugin and I faced this issue, solved updating also m2e-android eclipse plugin. Now, I'm able to compile my project through console, but not with eclipse. This is the exception thrown by pom.xml file in eclipse:

dependency=[com.actionbarsherlock:library:apklib:4.1.0:compile] not found in workspace

In previous versions of ADT/m2e-android, I was able to build both console and eclipse without problems.

Does anyone know how to solve this? Maybe my pom.xml is wrong?

Thanks for your time.


Currently using:

  • Eclipse classic 3.7.2 (with Juno the problem persists)
  • ADT 20.0.3
  • m2e-android 0.42
  • android-maven-plugin 3.3.0
  • maven 3.0.4
  • m2e 1.1.0 (included as a dependency in m2e-android 0.42)

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>

EDIT:

Answer is right. Having ABS library project mavenized in my workspace, error is gone! But, another problem appeared: ABS transitive dependencies are added to my project, causing eclipse to be not able to launch the application. This is a known issue you can follow here.

解决方案

As of Android 0.4.2 you now need to mavenise the Android library projects in your Eclipse workspace for m2e-android to successfully detect them. The POM for ActionBarSherlock can be found here:

https://github.com/JakeWharton/ActionBarSherlock/blob/master/library/pom.xml#

Note: m2e-android is beta software and so changes that might affect functionality can occur between releases.

这篇关于ActionBarSherlock + maven + eclipse:在工作空间中找不到依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆