我是Spoon的新手。我只知道使用Spoon我们可以分析和转换源代码。我想在我的gradle项目中使用Spoon。我正在使用这个项目的IntelliJ想法。当我试图构建这个项目时,我得到了这个错误。
错误:
Execution failed for task ':spoon'.
> org/eclipse/jdt/internal/core/util/CommentRecorderParser我的build.gradle文件如下:
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'
)
}
}我在用--stacktrace构建的时候得到了这个
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/core/util/CommentRecorderParser请帮我解决这个问题。提前感谢
发布于 2017-07-29 17:02:17
spoon会发生这种情况,因为它在类路径中找不到org/eclipse/jdt/internal/core/util/CommentRecorderParser类。将以下代码添加到您的buildscript依赖项中应该可以解决这个问题:
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'
}}
https://stackoverflow.com/questions/45381513
复制相似问题