POM error when using ActionbarSherlock with Eclipse and Maven

I am running a project that I want to compile with both Eclipse and Maven. On the command line everything works fine and if I remove the Maven nature the project works fine in Eclipse. However with Maven enabled I get this error on the first line of the POM

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

      

Here's my complete 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>

      

I also noticed that there is no ABS link from Eclipse-> Properties-> Android-> Library

What am I missing in this setup?

+3


source to share


2 answers


Like me, I compile Maven and Eclipse, however I am not using maven nature as it was too painful when I tried to use it.

Considering your error mentions ABS and it is an APKLIB that is "tampered with" by Maven, you may need to make sure that this APKLIB is installed in your local maven repository. I don't believe the nature of maven supports workspace resolution, but I might be wrong about that.



If that doesn't work, you can always follow my example and just set the default eclipse, which would mean turning off the maven nature and linking it with Eclipse-> Properties-> Android-> Library as you mentioned

+2


source


I got stuck with this and tried the following and it worked:



right click on project -> maven -> update project config -> select all -> enjoy!

0


source







All Articles