簡體   English   中英

args4J 不適用於 gradle

[英]args4J doesn't work with gradle

我是 gradle 的新手,所以這可能是一個明顯的問題:

我將 eclipse 與 gradle 一起使用,實際上我沒有問題為 junit 或東西添加依賴項,它將 junit 庫添加到 gradle 依賴項並且使用 883898555942288 沒有問題,但是如果添加 i4 依賴項,則 args 嘗試使用它只是行不通。

只是為了確保 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'

使用 gradle-7.1 這對我有用:

// build.gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation group: 'args4j',    name: 'args4j',         version: '2.33'
    implementation group: 'args4j',    name: 'args4j-site',    version: '2.33'
}
 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM