Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception in thread "pool-1-thread-1" java.lang.NoClassDefFoundError: org/eclipse/aether/spi/connector/Transfer$State

Hii everyone I am trying to generate automated Maven build script for android project i'm using Maven 3.2.5 for generating build and i'm getting following issues while trying to generate script for sample helloworld project

   Exception in thread "pool-1-thread-1"java.lang.NoClassDefFoundError:org/eclipse/aether/spi/connector/Transfer$State
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:608)

i'm using following script for building

<?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.example.helloworld</groupId>
<artifactId>HelloWorld</artifactId>
<version>0.1.0</version>
<packaging>apk</packaging>

<properties>
    <!-- use UTF-8 for everything -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>4.1.1.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility-v4</artifactId>
        <version>21.0.3</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>3.9.0-rc.1</version>
            <configuration>
                <sdk>
                    <platform>21</platform>
                </sdk>
                <deleteConflictingFiles>true</deleteConflictingFiles>
                <undeployBeforeDeploy>true</undeployBeforeDeploy>
            </configuration>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

tried changing and searched in google didn't find solution please help me

like image 894
sainath Avatar asked Feb 25 '15 11:02

sainath


2 Answers

It seems that there is a compatibility issues between android-maven-plugin and the maven release 3.2.5 and later.

For me it works on a 3.2.3 and fails with NoClassDefFoundError exception when I use 3.2.5 and 3.3.1

Try to download an older maven version from the archives at http://archive.apache.org/dist/maven/maven-3/3.2.3/


Edit

This issue is fixed in later versions(testet with 4.1.1) of the android-maven-plugin. The plugin has moved to github, and is relocated to a new groupId.

  <plugin>
    <groupId>com.simpligility.maven.plugins</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <version>4.1.1</version>
  </plugin>

New project location: https://github.com/simpligility/android-maven-plugin/

like image 114
Phylock Avatar answered Nov 18 '22 23:11

Phylock


There is some compatibility problem for maven 3.2 & 3.3. Try this:

brew install homebrew/versions/maven31
sudo ln -s /usr/local/Cellar/maven31/3.1.1 /usr/local/Cellar/maven/
brew switch maven 3.1.1
like image 1
Victor Choy Avatar answered Nov 19 '22 00:11

Victor Choy