ActionBarSherlock maven依赖

时间:2012-12-04 17:36:21

标签: actionbarsherlock

我一直在尝试使用

将ActionbarSherlock maven依赖项添加到我的项目中
<dependency>
    <groupId>com.actionbarsherlock</groupId>
    <artifactId>library</artifactId>
    <version>4.2.0</version>
</dependency>

在我的pom.xml文件中。现在这个工作除了我的styles.xml文件,它似乎不是abs样式,但其他一切工作正常?我究竟做错了什么。下面是完整的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.xyz</groupId>
    <artifactId>abc</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>apk</packaging>
    <name>abc Android Application</name>

    <dependencies>
        <dependency>
            <groupId>org.springframework.android</groupId>
            <artifactId>spring-android-rest-template</artifactId>
            <version>1.0.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.8</version>
        </dependency>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>4.1.1.4</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>
    <build>
        <finalName>${project.artifactId}</finalName>
        <sourceDirectory>src/main/java</sourceDirectory>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <version>3.0.0</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <configuration>
                    <sdk>
                        <platform>16</platform>
                    </sdk>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project> 

1 个答案:

答案 0 :(得分:5)

ActionBarSherlock是一个库项目,这意味着您需要向Maven依赖声明添加<type>apklib</type>

<dependency>
  <groupId>com.actionbarsherlock</groupId>
  <artifactId>actionbarsherlock</artifactId>
  <version>4.2.0</version>
  <type>apklib</type>
</dependency>

(请注意,我还将artifactId更改为'actionbarsherlock')

要执行此操作,您需要android-maven-plugin引用<extensions>true</extensions>。看来您已经从粘贴的pom.xml完成了此要求。