美文网首页
eureka编译时的问题

eureka编译时的问题

作者: 王侦 | 来源:发表于2020-05-24 19:08 被阅读0次

    eureka编译时会发生各种问题,基本上都是版本不匹配造成的:

    Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.
    

    1.build.gradle文件配置

    build.gradle 文件配置:

    注意事项:

    • 一定要使用阿里云镜像,不然下到老下不完

      maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }

    • id 'nebula.netflixoss' version '5.1.1', 版本选择大一点

    • languageLevel = '1.8'

    • sourceCompatibility = 1.8 , targetCompatibility = 1.8

    buildscript {
        repositories {
            maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        }
    
        dependencies {
            classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.+'
        }
    }
    
    plugins {
        id 'nebula.netflixoss' version '5.1.1'
    }
    
    idea {
        project {
            languageLevel = '1.8'
        }
    }
    
    if (JavaVersion.current().isJava8Compatible()) {
        allprojects {
            tasks.withType(Javadoc) {
                options.addStringOption('Xdoclint:none', '-quiet')
            }
        }
    }
    
    allprojects {
        ext {
            githubProjectName = 'eureka'
            awsVersion = '1.11.105'
            servletVersion = '2.5'
            jerseyVersion = '1.19.1'
            jettisonVersion = '1.3.7'
            apacheHttpClientVersion = '4.3.4'
            guiceVersion = '4.1.0'
            servoVersion = '0.10.1'
            governatorVersion = '1.12.10'
            archaiusVersion = '0.7.5'
            blitzVersion = '1.34'
            mockitoVersion = '1.10.19'
            junit_version = '4.11'
            mockserverVersion = '3.9.2'
            jetty_version = '7.2.0.v20101020'
            jacksonVersion = '2.8.7'
            woodstoxVersion = '4.4.1'
        }
        repositories {
            maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    
        }
    }
    
    subprojects {
        apply plugin: 'nebula.netflixoss'
        apply plugin: 'java'
    
        group = "com.netflix.${githubProjectName}"
    
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    
        repositories {
            jcenter()
        }
    
        test {
            forkEvery = 1
            // setting this property prevents java from grabbing focus when running the tests under osx
            systemProperty 'java.awt.headless', 'true'
        }
    
        jar {
            manifest {
                attributes('Build-Time-ISO-8601': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"))
            }
        }
    }
    
    
    

    2.Gradle 版本不要超过4,不然会报错

    eureka\gradle\wrapper\gradle-wrapper.properties

    我选择的gradle 版本是 gradle-3.5.1

    #Thu Apr 30 10:13:13 PDT 2020
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-bin.zip
    

    3.Idea版本选择2018版本,不然很可能报错

    相关文章

      网友评论

          本文标题:eureka编译时的问题

          本文链接:https://www.haomeiwen.com/subject/oewjahtx.html