简体   繁体   English

Gradle:找不到org.codehaus.groovy:groovy:1.0.0

[英]Gradle : Could not find org.codehaus.groovy:groovy:1.0.0

I am using gradle to compile my Groovy and Java code. 我正在使用gradle编译我的Groovy和Java代码。 today I update my groovy 2.5.4 and upgrade gradle to version 5. 今天,我更新了groovy 2.5.4并将gradle升级到了版本5。

gradle run command failing now with this error message. gradle run命令现在失败,并显示此错误消息。

 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. 这是build.gradle文件。

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 谢谢SR

You can replace your groovyldap dependency declaration with the following (as already mentioned by @paul-king in the comments): 您可以将groovyldap依赖项声明替换为以下内容(如@ paul-king在评论中所述):

    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. 我不知道您的groovyldap依赖项是否仍然可以在Groovy 2.5.4中使用,但是绝对值得一试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Gradle 从命令行构建失败并出现异常,“无法初始化 class org.codehaus.groovy.runtime.InvokerHelper” - Gradle build from command line fails with an exception, “Could not initialize class org.codehaus.groovy.runtime.InvokerHelper” Gradle 错误:无法初始化 class org.codehaus.groovy.runtime.InvokerHelper - Gradle error: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper android 工作室 org.codehaus.groovy。 无法投射 gradle 错误 - android studio org.codehaus.groovy. cant cast gradle error 错误无法初始化 class org.codehaus.groovy.runtime.InvokerHelper - Error Could not initialize class org.codehaus.groovy.runtime.InvokerHelper 无法初始化 class org.codehaus.groovy.runtime.InvokerHelper - Could not initialize class org.codehaus.groovy.runtime.InvokerHelper 无法初始化类 org.codehaus.groovy.reflection.ReflectionCache - Could not initialize class org.codehaus.groovy.reflection.ReflectionCache 使用 Oracle JDK 14 时,所有 gradle (6.2.2) 任务都失败并显示“无法初始化类 org.codehaus.groovy.runtime.InvokerHelper” - When using Oracle JDK 14 all gradle (6.2.2) tasks fail with "Could not initialize class org.codehaus.groovy.runtime.InvokerHelper" java中的org / codehaus / groovy / control / CompilationFailedException - org/codehaus/groovy/control/CompilationFailedException in java 引起:org.codehaus.groovy.control.MultipleCompilationErrorsException - Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException 获取 NoClassDefFoundError:无法初始化类 org.codehaus.groovy.vmplugin.v7.Java7 - Getting NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM