0

When I run the command mvn clean install on a library project I am using, I get an error from maven saying that a command could not be run. When I run the command it gives me a bunch of compiler errors related to the fact that maven is compiling with android-9 instead of android-17 that is specified in both the pom.xml and the AndroidManifest.xml

I could really use some direction. Thanks

pom.xml for BoD/android-switch-backport

<?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>

<!-- Needed to deploy to Maven Central. -->

<parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
</parent>


<!-- Informational stuff. -->

<groupId>org.jraf</groupId>
<artifactId>android-switch-backport</artifactId>
<version>1.1-SNAPSHOT</version>
<packaging>apklib</packaging>
<name>Android Switch Backport</name>
<description>
    A backport of the Switch widget (http://developer.android.com/reference/android/widget/Switch.html)
    that was introduced on Android 4.
    This port works on Android 2.1+.
</description>
<url>https://github.com/BoD/android-switch-backport</url>

<licenses>
    <license>
        <name>Apache 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        <distribution>repo</distribution>
    </license>
</licenses>

<scm>
    <url>[email protected]:BoD/android-switch-backport.git</url>
    <connection>scm:git:[email protected]:BoD/android-switch-backport.git</connection>
    <developerConnection>scm:git:[email protected]:BoD/android-switch-backport.git</developerConnection>
</scm>

<issueManagement>
    <url>https://github.com/BoD/android-switch-backport/issues</url>
    <system>GitHub Issues</system>
</issueManagement>

<developers>
    <developer>
        <id>BoD</id>
        <name>Benoit 'BoD' Lubek</name>
        <email>[email protected]</email>
        <url>http://JRAF.org</url>
        <organization>JRAF.org</organization>
        <organizationUrl>http://JRAF.org</organizationUrl>
        <roles>
            <role>developer</role>
        </roles>
        <timezone>+1</timezone>
        <properties>
            <picUrl>https://en.gravatar.com/userimage/4833932/c2a1aef7adad2526e299518b325c2787.png</picUrl>
        </properties>
    </developer>
</developers>


<!-- Actually useful stuff. -->

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>4.2.2</version>
        <scope>provided</scope>
    </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>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
                <execution>
                    <id>sign-artifacts</id>
                    <phase>package</phase>
                    <goals>
                        <goal>sign</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

1
  • Post your pom file please. Commented Sep 10, 2013 at 0:22

1 Answer 1

2
<plugin>
  <groupId>com.jayway.maven.plugins.android.generation2</groupId>
  <artifactId>android-maven-plugin</artifactId>
  <version>3.5.0</version>
  <extensions>true</extensions>
  <configuration>
    <sdk>
      <platform>17</platform> <!-- since you are dependent on 4.2.2 -->
    </sdk>
  <configuration>
</plugin>

Step by step approach.

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  <android.version>2.3.3</android.version>
  <android.api.level>10</android.api.level>
</properties>
<dependencies>
  <dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android</artifactId>
    <version>${android.version}</version>
    <scope>provided</scope>
  </dependency>
</dependencies>
<plugin>
  <groupId>com.jayway.maven.plugins.android.generation2</groupId>
  <artifactId>android-maven-plugin</artifactId>
  <configuration>
    <sdk>
      <platform>${android.api.level}</platform>
    </sdk>
    <apk>
      <metaIncludes>
        <metaInclude>services/**</metaInclude>
      </metaIncludes>
    </apk>
  </configuration>
</plugin>

Please take a look at here for more information.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.