vaadin 23.3.19 gradle插件与冲突的jna和oshi依赖

332nm8kg  于 2023-10-19  发布在  其他
关注(0)|答案(1)|浏览(146)

我正在应用vaadin 23.3.19 gradle插件并运行vaadinBuildFrontend任务。它失败是因为com.github.oshinet.java.dev.jna库冲突。方法Memory.close()不存在。
要构建的应用程序本身在类路径上有vaadinoshijna。但是我假设插件本身应该有它的独立的类路径和适当的库。如果是这样,为什么会失败?
或者它是否与应用程序依赖项提供的上述库一起工作?对于这种情况,我已经为冲突来自应用程序依赖项的情况添加了依赖项解决方案,但这仍然无法解决它。

configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            if (details.requested.group == 'com.github.oshi') {
                details.useVersion '6.4.1'
                details.because('conflicting version with jna/vaadin')
            }
            if (details.requested.group == 'net.java.dev.jna') {
                details.useVersion '5.13.0'
                details.because('conflicting version with jna/vaadin')
            }
        }
    }
Suppressed: java.lang.NoSuchMethodError: 'void com.sun.jna.Memory.close()'
                at oshi.util.platform.mac.SysctlUtil.sysctl(SysctlUtil.java:53)
                at oshi.util.platform.mac.SysctlUtil.sysctl(SysctlUtil.java:40)
                at oshi.hardware.platform.mac.MacCentralProcessor.initProcessorCounts(MacCentralProcessor.java:119)
                at oshi.hardware.common.AbstractCentralProcessor.<init>(AbstractCentralProcessor.java:65)
                at oshi.hardware.platform.mac.MacCentralProcessor.<init>(MacCentralProcessor.java:47)
                at oshi.hardware.platform.mac.MacHardwareAbstractionLayer.createProcessor(MacHardwareAbstractionLayer.java:42)
                at oshi.util.Memoizer$1.get(Memoizer.java:61)
                at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:48)
                at com.vaadin.pro.licensechecker.MachineId.getComputerId(MachineId.java:34)
                at com.vaadin.pro.licensechecker.MachineId.get(MachineId.java:19)
                at com.vaadin.pro.licensechecker.LicenseChecker.checkLicense(LicenseChecker.java:226)
                at com.vaadin.pro.licensechecker.LicenseChecker.checkLicense(LicenseChecker.java:129)
                at com.vaadin.pro.licensechecker.LicenseChecker.checkLicense(LicenseChecker.java:104)
                at com.vaadin.flow.server.frontend.CvdlProducts.includeInFallbackBundle(CvdlProducts.java:93)
                at com.vaadin.flow.server.frontend.TaskUpdateImports.lambda$filter$0(TaskUpdateImports.java:486)
                at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
                at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
                at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
                at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
                at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
                at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
                at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
                at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
                at com.vaadin.flow.server.frontend.TaskUpdateImports$UpdateFallBackImportsFile.getModules(TaskUpdateImports.java:278)
                at com.vaadin.flow.server.frontend.AbstractUpdateImports.collectModules(AbstractUpdateImports.java:314)
                at com.vaadin.flow.server.frontend.AbstractUpdateImports.run(AbstractUpdateImports.java:128)
                at com.vaadin.flow.server.frontend.TaskUpdateImports.execute(TaskUpdateImports.java:388)
                at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:342)
                at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:343)
                at com.vaadin.gradle.VaadinBuildFrontendTask.vaadinBuildFrontend(VaadinBuildFrontendTask.kt:71)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
                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:248)
                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:233)
                at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:216)
                at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:199)
                at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:166)
                at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
                at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
                at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
                at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
                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:56)
                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:179)
                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 java.base/java.util.Optional.orElseGet(Optional.java:369)
                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:77)
                at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:38)
                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:293)
                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:47)
                at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
                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:337)
                at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:324)
                at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:317)
                at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
                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.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                at java.base/java.lang.Thread.run(Thread.java:829)
gv8xihay

gv8xihay1#

Vaadin 23.3.19使用license-checker 1.12.3,它使用oshi-core 6.4.1和jna/jna-platform 5.13.0。
你的应用程序定义了哪些版本的oshi和jna(或者使用它们作为可传递的deps)?
为了检查应用程序级别的deps是否是孤立的,我尝试使用23.3.19运行https://github.com/vaadin/base-starter-gradle/tree/v23 starter项目,并定义了一个随机的jna版本

implementation "net.java.dev.jna:jna:5.10.0"

然后通过运行

./gradlew clean build -Pvaadin.productionMode --info

我已经成功构建了一个日志中的以下行:

Passing this classpath to NodeTasks.Builder: [javax.servlet-api-3.1.0.jar, javax.websocket-api-1.0.jar, vaadin-core-23.3.19.jar, slf4j-simple-1.7.36.jar, vaadin-dev-server-23.3.16.jar, **license-checker-1.12.3.jar, oshi-core-6.4.1.jar, jna-platform-5.13.0.jar, jna-5.13.0.jar**, ...]

因此,插件仍然使用其配置中定义的版本,而不是应用程序中的版本。
这只是一个假设,但看起来你的项目不知何故使用了不同版本的Vaadin gradle插件和Vaadin平台(例如beta版本23.3),所以我会先检查一下。这可能会给给予这类错误。
你能运行--info并给予记录的版本吗?

相关问题