我对 gradle 完全陌生,所以这可能是一个明显的问题:
我将 Eclipse 与 gradle 一起使用,实际上为 junit 或其他东西添加依赖项没有问题,它将 junit lib 添加到 gradle 依赖项中,使用 junit 没有问题,但如果我尝试使用 args4j (也添加依赖)它根本不起作用。
只是为了确保build.gradle没有问题
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'title',
'Implementation-Version': version,
'Main-Class':'path.to.main.Main'
}
}
repositories {
mavenCentral()
}
test {
systemProperties 'property': 'value'
}
dependencies{
compile 'args4j:args4j-site:2.0.25'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
不,我没有使用 title 或 path.to.main ^^
Eclipse 显示导入(args4j)无法解析
最佳答案
您忘记了主“args4j”模块:
compile group: 'args4j', name: 'args4j', version: '2.0.25'
compile group: 'args4j', name: 'args4j-site', version: '2.0.25'
关于java - args4J 不适用于 gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28054933/