zoukankan      html  css  js  c++  java
  • IDEA,与gradle引入jar包报错

    Warning:<i><b>root project 'netty_lecture': Unable to resolve additional project configuration.</b>
    Details: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':compileClasspath'.
    Caused by: org.gradle.internal.resolve.ArtifactResolveException: Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.5.1)
    Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.5.1/protobuf-java-3.5.1.jar'.
    Caused by: java.net.SocketTimeoutException: Read timed out</i>

    引入Google protobuf的时候报上述错误

    group 'com.jiangdashuai'
    version '1.0'
    
    apply plugin: 'java'
    
    sourceCompatibility = 1.8
    
    repositories {
        mavenCentral()
    }
    
    dependencies {
    //    testCompile group: 'junit', name: 'junit', version: '4.12'
        compile(
                 'io.netty:netty-all:4.1.19.Final',
                'com.google.protobuf:protobuf-java:3.5.1',
                'com.google.protobuf:protobuf-lite:3.0.1'
        )
    }

    将引入的插件

    apply plugin: 'java'

    改为

    apply plugin: 'java'
    apply plugin: 'idea'
  • 相关阅读:
    08 正则表达式
    07 函数&对象
    06 Math&Date&Json
    05 数组&字符串
    04 循环控制
    03 流程控制
    02 数据类型&运算符
    大道至简
    Avg_row_length是怎么计算的?
    理解innodb buffer pool
  • 原文地址:https://www.cnblogs.com/dashuai01/p/8367626.html
Copyright © 2011-2022 走看看