java - args4J 不适用于 gradle

标签 java eclipse gradle

我对 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/

相关文章:

java - 使用 ifPresent 在 JAVA 8 中检查 NULL 安全对象

java - 将pdf文件添加到swing java中的jeditorpane中

eclipse - jface tableviewer 单元格跨度

java - 当我打开自己的现有项目时,发生此 gradle 构建错误

android - Gradle Sync失败:没有这样的属性:Gradle版本对于类:JetGradlePlugin

spring-boot - Gradle bootRun 从多模块项目中的父文件夹

java - "SyncAdapter"执行过程中出现异常

java - JPA Hibernate - 使用给定 ID 插入,而不是序列

java - 仅更改 Eclipse 待办事项的颜色 - 而不是整个评论

Eclipse 更新(很少)有效 : No repository found containing -- many entries