Spring Boot Vaadin 24.0.0 Bootstrap 组织.gradle.API.任务,任务执行异常:执行任务“:vaadinBuildFrontend”失败

4ktjp1zp  于 2023-03-18  发布在  Spring
关注(0)|答案(1)|浏览(117)

我想建立我的后端+前端使用Vaadin 24.0.0与Spring Boot 3.0不幸的是下面的异常发生在bootJar gradle任务的exeuction期间。我不知道如何解决这个问题:(
执行gradle任务“bootJar”会产生此错误:

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':vaadinBuildFrontend'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:149)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:147)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:338)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:325)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:318)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:304)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
Caused by: org.gradle.internal.UncheckedException: com.vaadin.flow.server.ExecutionFailedException: Error occured during goal execution: Cannot invoke "java.lang.Class.isInterface()" because the return value of "org.reflections.Reflections.forClass(String, java.lang.ClassLoader[])" is nullPlease run Maven with the -e switch (or Gradle with the --stacktrace switch), to learn the full stack trace.
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:68)
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:128)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
    at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:242)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:227)
    at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:210)
    at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:193)
    at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:166)
    at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:93)
    at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
    at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:57)
    at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:54)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
    at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
    at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
    at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
    at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
    at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
    at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
    at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:28)
    at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.executeDelegateBroadcastingChanges(CaptureStateAfterExecutionStep.java:100)
    at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:72)
    at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:50)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
    at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:166)
    at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:70)
    at org.gradle.internal.Either$Right.fold(Either.java:175)
    at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
    at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:68)
    at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:46)
    at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:36)
    at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:25)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:91)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:55)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:37)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:76)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:37)
    at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:94)
    at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:49)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:71)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:45)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNonEmptySources(SkipEmptyWorkStep.java:177)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:81)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:53)
    at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
    at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
    at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
    at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
    at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:75)
    at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:41)
    at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:32)
    at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:287)
    at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
    at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:21)
    at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
    at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
    at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:42)
    at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:31)
    at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:64)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:338)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:325)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:318)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:304)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
Caused by: com.vaadin.flow.server.ExecutionFailedException: Error occured during goal execution: Cannot invoke "java.lang.Class.isInterface()" because the return value of "org.reflections.Reflections.forClass(String, java.lang.ClassLoader[])" is nullPlease run Maven with the -e switch (or Gradle with the --stacktrace switch), to learn the full stack trace.
    at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:341)
    at com.vaadin.gradle.VaadinBuildFrontendTask.vaadinBuildFrontend(VaadinBuildFrontendTask.kt:71)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
    ... 113 more
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Class.isInterface()" because the return value of "org.reflections.Reflections.forClass(String, java.lang.ClassLoader[])" is null
    at org.reflections.Reflections.lambda$getTypesAnnotatedWith$12(Reflections.java:405)
    at org.reflections.util.QueryFunction.lambda$filter$3(QueryFunction.java:32)
    at org.reflections.util.QueryFunction.lambda$add$9(QueryFunction.java:66)
    at org.reflections.util.QueryFunction.lambda$add$9(QueryFunction.java:66)
    at org.reflections.util.QueryFunction.lambda$asClass$13(QueryFunction.java:89)
    at org.reflections.Reflections.get(Reflections.java:365)
    at org.reflections.Reflections.getTypesAnnotatedWith(Reflections.java:403)
    at com.vaadin.flow.server.scanner.ReflectionsClassFinder.getAnnotatedClasses(ReflectionsClassFinder.java:67)
    at com.vaadin.flow.server.frontend.scanner.ClassFinder$CachedClassFinder.lambda$getAnnotatedClasses$0(ClassFinder.java:154)
    at com.vaadin.flow.server.frontend.scanner.ClassFinder$CachedClassFinder.getAnnotatedClasses(ClassFinder.java:153)
    at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.collectAnnotationValues(FullDependenciesScanner.java:299)
    at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.<init>(FullDependenciesScanner.java:146)
    at com.vaadin.flow.server.frontend.scanner.FullDependenciesScanner.<init>(FullDependenciesScanner.java:108)
    at com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner$FrontendDependenciesScannerFactory.createScanner(FrontendDependenciesScanner.java:121)
    at com.vaadin.flow.server.frontend.NodeTasks.getFallbackScanner(NodeTasks.java:288)
    at com.vaadin.flow.server.frontend.NodeTasks.lambda$new$5162cb1b$1(NodeTasks.java:224)
    at com.vaadin.flow.server.frontend.TaskUpdateImports.<init>(TaskUpdateImports.java:346)
    at com.vaadin.flow.server.frontend.NodeTasks.<init>(NodeTasks.java:222)
    at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:335)
    ... 116 more

gradle-wrapper.properties 内容:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip

build.gradle内容:

plugins {
    id "java"
    id "application"
    id 'org.springframework.boot' version '3.0.4'
    id 'io.spring.dependency-management' version '1.1.0'
    id 'com.vaadin' version '24.0.0'
    id("org.jetbrains.kotlin.jvm") version "${kotlinVersion}"
    id("org.jetbrains.kotlin.kapt") version "${kotlinVersion}"
    id("org.jetbrains.kotlin.plugin.allopen") version "${kotlinVersion}"
    id "org.jetbrains.kotlin.plugin.jpa" version "${kotlinVersion}"
}

apply plugin: 'kotlin'

group = 'com.company'
version = '1.0.0'
sourceCompatibility = JavaVersion.VERSION_18

repositories {
    mavenCentral()
    maven {
        url "https://maven.vaadin.com/vaadin-addons"
    }
    maven { url 'https://jitpack.io' }
    jcenter()
}

ext {
    set('vaadinVersion', "24.0.0")
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation('org.springframework.boot:spring-boot-starter-web') {
        exclude group: 'com.fasterxml.jackson.core'
        exclude group: 'com.fasterxml.jackson.datatype'
        exclude group: 'com.fasterxml.jackson.module'
    }
    implementation 'org.springframework.boot:spring-boot-starter-tomcat:3.0.4'
    implementation 'org.springframework.boot:spring-boot-starter-parent:3.0.4'
    implementation 'org.springframework.boot:spring-boot-starter-mail:3.0.4'
    implementation 'org.springframework.boot:spring-boot-configuration-processor:3.0.4'
    implementation 'com.vaadin:vaadin-spring-boot-starter'
    implementation 'org.springframework.boot:spring-boot-starter-actuator:3.0.4'
    implementation 'org.springframework.boot:spring-boot-loader:3.0.4'
    implementation 'org.springframework:spring-context-indexer:6.0.6'
    implementation 'com.vaadin:vaadin-bom:24.0.0'
    runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

    implementation 'com.google.code.gson:gson:2.10.1'
//    implementation group: 'org.sql2o', name: 'sql2o', version: '1.6.0'
//  implementation 'org.hibernate.orm:hibernate-core:6.0.0.Final'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa:3.0.4'
    implementation 'com.h2database:h2:2.1.214'
    implementation 'org.postgresql:postgresql:42.5.4'

    implementation group: 'mysql', name: 'mysql-connector-java', version: '8.0.19'
    implementation 'de.mkammerer:argon2-jvm:2.11'
    implementation("com.rfksystems:blake2b:1.0.0")
//    implementation group: 'org.json', name: 'json', version: '20190722'
    implementation 'org.apache.tika:tika-core:2.3.0'
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
    implementation group: 'commons-codec', name: 'commons-codec', version: '1.11'
    implementation group: 'commons-io', name: 'commons-io', version: '2.11.0'

    implementation('org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4')
    implementation('org.jetbrains.kotlinx:kotlinx-coroutines-reactor:1.6.4')
    implementation 'org.jetbrains.kotlin:kotlin-reflect:1.7.20'

    implementation 'com.aventrix.jnanoid:jnanoid:2.0.0'

    compileOnly 'org.projectlombok:lombok:1.18.24'

    api 'io.jsonwebtoken:jjwt-api:0.11.5'
    runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
    // Uncomment the next line if you want to use RSASSA-PSS (PS256, PS384, PS512) algorithms:
    //'org.bouncycastle:bcprov-jdk15on:1.60',
//            'io.jsonwebtoken:jjwt-jackson:0.11.5' // or 'io.jsonwebtoken:jjwt-gson:0.11.2' for gson
    runtimeOnly 'io.jsonwebtoken:jjwt-orgjson:0.11.5'

    implementation 'com.google.firebase:firebase-admin:9.1.1'
    implementation 'com.sun.mail:jakarta.mail:2.0.1'

    //https://codecouple.pl/2017/01/07/9-spring-boot-swagger2-dokumentujemy-api/
//  implementation 'io.springfox:springfox-swagger2:3.0.0'
//  implementation 'io.springfox:springfox-swagger-ui:3.0.0'

    implementation 'org.apache.poi:poi-ooxml:5.2.2'

    implementation 'org.springdoc:springdoc-openapi-ui:1.6.11'
    implementation 'org.springdoc:springdoc-openapi-kotlin:1.6.11'

    implementation 'org.jsoup:jsoup:1.14.3'
    implementation 'com.github.vladimir-bukhtoyarov:bucket4j-core:7.6.0'

    implementation 'com.github.oshi:oshi-core:6.2.2'
    implementation 'org.imgscalr:imgscalr-lib:4.2'
    implementation 'net.java.dev.jna:jna:5.13.0'

    implementation 'org.vaadin.miki:superfields:0.13.0'
//    implementation 'org.vaadin:tinymce-for-flow:3.2.0'
    implementation 'com.wontlost:ckeditor-vaadin:3.2.1'

    implementation 'net.usrlib:material-color:0.2'
//    implementation 'org.vaadin.addons:vaadin-wrapper-for-tinymce:5.1'
//    implementation 'org.vaadin.klaudeta:quill-editor:1.0.1'

//    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}"

    implementation('com.squareup.okhttp3:okhttp:4.10.0')
    implementation('com.squareup.okhttp3:okhttp-tls:4.10.0')
    implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'

//    implementation("com.azure:azure-core:1.33.0")
//    implementation("com.microsoft.azure:msal4j:1.13.2")

    // Include the sdk as a dependency
//    implementation 'com.microsoft.graph:microsoft-graph:5.36.0'
    // Uncomment the line below if you are building an android application
    //implementation 'com.google.guava:guava:30.1.1-android'
    // This dependency is only needed if you are using the TokenCrendentialAuthProvider
//    implementation("com.azure.spring:spring-cloud-azure-starter-active-directory:4.3.0")
//    implementation("org.springframework.boot:spring-boot-starter-oauth2-client:3.0.4")
    testImplementation 'org.json:json:20220924'
    testImplementation 'org.jetbrains.kotlin:kotlin-test'

}

dependencyManagement {
    imports {
        mavenBom "com.vaadin:vaadin-bom:${vaadinVersion}"
    }
}

test {
    useJUnitPlatform()
    testLogging.showStandardStreams = true
}

compileKotlin {
    kotlinOptions.jvmTarget = JavaVersion.VERSION_18
    kotlinOptions {
        freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
        freeCompilerArgs += "-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi"
        freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
        freeCompilerArgs += "-opt-in=kotlin.ExperimentalStdlibApi"
    }
}

java {
    sourceCompatibility = JavaVersion.VERSION_18
    targetCompatibility = JavaVersion.VERSION_18
}

compileJava {
    sourceCompatibility = JavaVersion.VERSION_18
    targetCompatibility = JavaVersion.VERSION_18
    options.compilerArgs += ['--enable-preview']
}

compileTestKotlin {
    kotlinOptions.jvmTarget = JavaVersion.VERSION_18
    kotlinOptions {
        freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
        freeCompilerArgs += "-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi"
        freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
    }
}

application {
    mainClass.set("com.company.akademia.App")
}

vaadin {
    def mode = props.getProperty("spring.profiles.active")
    def isProduction = mode.equalsIgnoreCase("prod") || mode.equalsIgnoreCase("production") || mode.equalsIgnoreCase("rel") || mode.equalsIgnoreCase("release") || mode.equalsIgnoreCase("staging")
    pnpmEnable = true
    productionMode = isProduction
    generateBundle(productionMode)
    optimizeBundle(productionMode)
    vaadinClean

    vaadinBuildFrontend
}

jar {
//    archivesBaseName = archivesBaseName + '-' + archiveVersion
    zip64 = true
    exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
    duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
    from {
        configurations.runtimeClasspath.collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }

}

springBoot {
    buildInfo()
}

bootJar {
    enabled = true
    archiveFileName = 'akademia.jar'
    archiveBaseName.set('akademia')
    mainClassName = 'com.company.akademia.AppKt'
    duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}
tasks.withType(JavaExec) {
    jvmArgs += '--enable-preview'
}

tasks.withType(JavaCompile).all {
    options.compilerArgs += ['--enable-preview']
}

tasks.withType(Test).all {
    jvmArgs += '--enable-preview'
}

tasks.withType(JavaExec) {
    jvmArgs += '--enable-preview'
}

如何解决这个问题?无法构建生产就绪的应用程序:(

x8diyxa7

x8diyxa71#

看起来像是org.reflections库中的错误:NameHelper.forClass()可能返回null,但Reflections:405不考虑这一点。
我们应该在https://github.com/ronmamo/reflections/issues上提交一个bug报告,但是首先我们需要找出在Reflections:405上的调用返回null的类名-c变量的值。
我认为最简单的方法是在调试模式www.example.com下运行Gradlehttps://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_build_logic,然后添加一个捕获NPE的断点,然后调试对getTypesAnnotatedWith()的调用。
当我们学习类名时,我们可以分析这个类,看看它有什么特别之处。它会给你两方面的帮助:

  • 您可以排除/移除/重新编译/修改类作为解决方法,以使构建通过
  • 您可以提交org.reflections库的错误报告,并提供有关该问题的详细信息。

相关问题