'args4J doesn't work with gradle

I'm totally new to gradle so it may be a obvious problem:

I'm using eclipse with gradle and I actually have no problem adding dependencies for junit or stuff, it adds the junit lib to the gradle dependencies and there's no problem using junit, but if i try to use args4j (also with adding the dependency) it just doesn't work.

Just to make sure there's no problem with the 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.+'
}

and No I'm not using title or path.to.main ^^

Eclipse shows me that the import (args4j) cannot be resolved



Solution 1:[1]

You forgot main "args4j" module:

compile group: 'args4j',             name: 'args4j',        version: '2.0.25'
compile group: 'args4j',             name: 'args4j-site',   version: '2.0.25'

Solution 2:[2]

With gradle-7.1 this works for me:

// build.gradle

repositories {
    mavenCentral()
}

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 yurgis
Solution 2 c4r510