简体   繁体   中英

Gradle : Could not find org.codehaus.groovy:groovy:1.0.0

I am using gradle to compile my Groovy and Java code. today I update my groovy 2.5.4 and upgrade gradle to version 5.

gradle run command failing now with this error message.

 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileGroovy'. > Could not resolve all files for configuration ':detachedConfiguration1'. > Could not find org.codehaus.groovy:groovy:1.0.0. Searched in the following locations: - https://jcenter.bintray.com/org/codehaus/groovy/groovy/1.0.0/groovy-1.0.0.pom - https://jcenter.bintray.com/org/codehaus/groovy/groovy/1.0.0/groovy-1.0.0.jar - http://repository.apache.org/snapshots/org/codehaus/groovy/groovy/1.0.0/groovy-1.0.0.pom - http://repository.apache.org/snapshots/org/codehaus/groovy/groovy/1.0.0/groovy-1.0.0.jar Required by: project : * Try: 

Here is the build.gradle file.

plugins {
    id 'groovy'
    id 'application'
}

repositories {
    jcenter()
      maven {
        url "http://repository.apache.org/snapshots/"
    }
}

dependencies {
    // Use the latest Groovy version for building this library
    implementation 'org.codehaus.groovy:groovy-all:2.5.4'
    compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
    compile group: 'commons-io', name: 'commons-io', version: '2.6'
    compile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.9'
    compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.6.1'
    compile group: 'org.apache.directory', name: 'groovyldap', version: '0.1-SNAPSHOT'
    // https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
    compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
    // https://mvnrepository.com/artifact/org.apache.directory.shared/shared-ldif
    compile group: 'org.apache.directory.shared', name: 'shared-ldif', version: '0.9.19'
    // https://mvnrepository.com/artifact/org.apache.directory.api/api-ldap-model
    compile group: 'org.apache.directory.api', name: 'api-ldap-model', version: '1.0.0-M15'
    // https://mvnrepository.com/artifact/com.opencsv/opencsv
    compile group: 'com.opencsv', name: 'opencsv', version: '4.0'
    // https://mvnrepository.com/artifact/org.jsoup/jsoup
    compile group: 'org.jsoup', name: 'jsoup', version: '1.11.2'
    compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.11'

    // https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc
    compile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '6.4.0.jre8'
    // https://mvnrepository.com/artifact/net.sourceforge.jtds/jtds
    compile group: 'net.sourceforge.jtds', name: 'jtds', version: '1.3.1'
    // https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
 // https://mvnrepository.com/artifact/org.yaml/snakeyaml
    compile group: 'org.yaml', name: 'snakeyaml', version: '1.21'

    // https://mvnrepository.com/artifact/com.rubiconproject.oss/jchronic
    compile group: 'com.rubiconproject.oss', name: 'jchronic', version: '0.2.8'

    compile group: 'io.github.http-builder-ng', name: 'http-builder-ng-core', version: '1.0.3'

    // Use the awesome Spock testing and specification framework
    testImplementation 'org.spockframework:spock-core:1.2-groovy-2.5'
}

// Define the main class for the application
mainClassName = 'ssl.test.App'

any help to resolve this error message?

Thanks SR

You can replace your groovyldap dependency declaration with the following (as already mentioned by @paul-king in the comments):

    compile(group: 'org.apache.directory', name: 'groovyldap', version: '0.1-SNAPSHOT') {
        exclude group: 'groovy', module: 'groovy'
    }

This will at least help you get rid of the dependency resolution error.

I don't know if your groovyldap dependency will still work with Groovy 2.5.4 but it's definitely worth a try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM