zoukankan      html  css  js  c++  java
  • 【gradle】之maven主库找不到Could not find org.restlet.jee:org.restlet:2.1.1


    Could not find org.restlet.jee:org.restlet:2.1.1.

    我是用gradle构建solr的时候出现的这个错误,通过google查询到这么一段解释

    For the record:
    
    The configurations default, gwtRuntime, modulesRuntime, runtime, setupRuntime are (implicitly) declared as transitive. All of them declare the dependency org.apache.solr:solr-core:4.3.0. This depends on org.restlet.jee:org.restlet:2.1.1 and org.apache.solr:solr-parent:4.3.0, and this last one in turn declares in its pom the "Public online Restlet repository" http://maven.restlet.org.
    
    But Gradle doesn't honor repositories declared in POMs, so gradle -q dependencies warns about failing to fetch org.restlet.jee:org.restlet:2.1.1
    
    I'm not sure how relevant all of this is, as it seems I still can compile and build a working webapp, but my IDE complains and throws and exception upon opening the project.

    解决办法是在build.gradle配置文件中,新增maven库

    repositories {
        mavenLocal()
        if (project.hasProperty('additional_repositories')){
            additional_repositories.split(';').each{ repo ->
                maven { url repo }
            }
        }
        mavenCentral()
    
        // Workaround for org.netbeans.gradle.model.util.TransferableExceptionWrapper:
        // org.gradle.internal.resolve.ModuleVersionNotFoundException: 
        // Could not find org.restlet.jee:org.restlet:2.1.1.
        maven {
            url "http://maven.restlet.org/" 
        }
    }

    这个错误在maven项目中很好解决,但是国内关注使用gradle的人并不多,所以网上没找到合适的解决方案,也没有能讲清楚原理的,关键时候还是得看google!

    原文如下:

     https://github.com/alkacon/opencms-core/issues/337

  • 相关阅读:
    包教包会之Open Live Writer设置代码样式
    走近Java之HashMap In JDK8
    走近Java之包装器类Integer
    走近Java之幕后的String
    一点心得
    一个简单的多线程代码实例
    C++实现快速排序
    力扣1025. 除数博弈
    力扣1721. 交换链表中的节点
    力扣1422. 分割字符串的最大得分
  • 原文地址:https://www.cnblogs.com/gyjx2016/p/6003796.html
Copyright © 2011-2022 走看看