aChartEngine app testing using Maven

I am rather new to Maven and I am having trouble using it. I have a working Android app, which uses aChartEngine, that runs fine in Eclipse but I need to use Maven for testing. There has been a repository set up for ACE but I can’t seem to access it properly. Here is my 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.mycompany.my-app</groupId>
<artifactId>my-app</artifactId>
<packaging>apk</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>my-app</name>

 <dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>4.1.1.4</version>
        <scope>provided</scope>
    </dependency>
<dependency>
    <groupId>org.achartengine</groupId>
        <artifactId>achartengine</artifactId>
        <version>1.1.0</version>
    </dependency>
</dependencies>
<repositories>
<repository>
        <id>achartengine</id>
        <name>Public AChartEngine repository</name>
        <url>https://repository-achartengine.forge.cloudbees.com/snapshot/</url>
    </repository> 
</repositories>
<build>
    <finalName>${project.artifactId}</finalName>
    <sourceDirectory>src</sourceDirectory>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <version>3.6.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 or api level (api level 16 = platform 4.1)-->
                    <platform>17</platform>
                </sdk>
            </configuration>
        </plugin>
    </plugins>
</build>

Is there something I’m doing wrong here? Let me know if I can add any more information.

Note that I am not using Maven from Eclipse, I am running it in a command prompt on windows 7.

UPDATE: I think I have found the problem but I’m not sure yet, so I’ll still post the error message:

[ERROR] Failed to execute goal on project my-app: Could not resolve dependencies for project com.mycompany:my-app:apk:0.0.1- SNAPSHOT: Could not find artifact org.achartengine:achartengine:jar:1.1.0 in …(my companies repository)

Answer

It turned out that the jar was not loaded into the repository that was being used. Got it all functional now.

Leave a Reply

Your email address will not be published. Required fields are marked *