Java Spring Boot 2在Gradle 4构建中失败,因为缺少StyledExtoutputFactory,但是为什么呢?

Java Spring Boot 2在Gradle 4构建中失败,因为缺少StyledExtoutputFactory,但是为什么呢?,java,spring-boot,gradle,build,Java,Spring Boot,Gradle,Build,我正试图建立一个基于David Steiman的OAuth2授权服务器。目前,我想检查所包含库的最新版本是否仍然有效。仅处理OAuth2ResourceServer子项目时,我更改了build.gradle中的相应条目,使其现在看起来像这样: buildscript { ext { springBootVersion = '2.0.0.BUILD-SNAPSHOT' } repositories { mavenCentral()

我正试图建立一个基于David Steiman的OAuth2授权服务器。目前,我想检查所包含库的最新版本是否仍然有效。仅处理
OAuth2ResourceServer
子项目时,我更改了
build.gradle
中的相应条目,使其现在看起来像这样:

buildscript {
    ext {
        springBootVersion = '2.0.0.BUILD-SNAPSHOT'
    }
    repositories {
        mavenCentral()
        maven { url "http://repo.spring.io/snapshot" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot' 

jar {
    baseName = 'demo'
    version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
}


dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.security.oauth:spring-security-oauth2:2.2.1.RELEASE')
    compile('org.springframework.security:spring-security-jwt:1.0.9.RELEASE')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}


eclipse {
    classpath {
         containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
         containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.9'
}
实际上,一开始,我尝试了Spring Boot版本
1.5.10.RELEASE
,它运行得非常好。但我需要使用弹簧5,因此弹簧靴2。但是对于
2.0.0.BUILD-SNAPSHOT
,spring boot Gradle插件告诉我必须至少使用Gradle 4.0,所以我不能使用示例项目附带的Gradle包装器。我的系统上安装了版本
4.2.1
,但也尝试了
4.5.1
。使用Gradle 4时,我得到的是:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\stefa\Projekte\spring-cloud-oauth2-example\OAuth2ResourceServer\build.gradle' line: 16

* What went wrong:
A problem occurred evaluating project ':OAuth2ResourceServer'.
> Failed to apply plugin [class 'io.spring.gradle.dependencymanagement.DependencyManagementPlugin']
> Could not create task of type 'DependencyManagementReportTask'.
相应堆栈跟踪的根本原因是:

...
Caused by: org.gradle.internal.service.UnknownServiceException: No service of type StyledTextOutputFactory available in ProjectScopeServices.
    at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:324)
    at org.gradle.api.internal.DependencyInjectingInstantiator.convertParameters(DependencyInjectingInstantiator.java:110)
    at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:79)
    at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:119)
    ... 144 more
这使我(在其他地方)陷入困境。据我所知,我使用的版本应该不再有问题了。但让我完全困惑的是,我实际上在我的“真实”项目中使用了Spring Boot
2.0.0.BUILD-SNAPSHOT
和Gradle
4.5.1
,它在那里工作得非常好

我创造了一个使用弹簧靴2和4级,工作非常好。我错过了什么