Execution completed for the spoon task. > org / eclipse / jdt / internal / core / util / CommentRecorderParser

I am new to Spoon. I just know that with Spoon we can parse and transform the source code. I want to use Spoon in my gradle project. I am using IntelliJ IDEA for this project. I am getting this error when I was trying to create a project.

Mistake:

Execution failed for task ':spoon'.
> org/eclipse/jdt/internal/core/util/CommentRecorderParser

      

My build.gradle

file looks like this:

group 'com.X'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile 'fr.inria.gforge.spoon:spoon-core:5.8.0'
}

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath group: 'fr.inria.gforge.spoon',
                name: 'spoon-gradle-plugin',
                version:'1.1'
    }
}

apply plugin: 'java'
apply plugin: 'spoon'

jar {
    manifest {
        attributes(
                'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
                'Main-Class': 'Main'
        )
    }
}

      

I got this when building with --stacktrace

Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/core/util/CommentRecorderParser

      

Please help me fix this. thanks in advance

+3


source to share


1 answer


This happens with a spoon because the class cannot be found org/eclipse/jdt/internal/core/util/CommentRecorderParser

in the classpath. Adding the following to your buildscript dependencies should do the trick:

buildscript {
repositories {
    mavenLocal()
    mavenCentral()
}
dependencies {
    classpath group: 'fr.inria.gforge.spoon',
            name: 'spoon-gradle-plugin',
            version:'1.1'
    classpath group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.12.2'
}

      



}

+1


source







All Articles