gpt4 book ai didi

gradle - 在子项目中找不到参数的方法实现

转载 作者:行者123 更新时间:2023-12-03 03:46:40 25 4
gpt4 key购买 nike

我有一个看起来像这样的多项目构建

talepath-poc-1
talepath-poc-1-backend
build.gradle
talepath-poc-1-ui
build.gradle
build.gradle
settings.gradle
settings.gradle
rootProject.name = 'talepath-poc-1'

include 'talepath-poc-1-backend'
include 'talepath-poc-1-ui'
talepath-poc-1
plugins {
id 'java'
}

group = 'com.lapots.breed'

allprojects {
group = 'com.lapots.breed'
}

subprojects {
version = '1.0-SNAPSHOT'
repositories {
jcenter()
}
}
talepath-poc-1-ui
plugins {
id 'org.gretty' version '2.3.1'
id 'com.devsoap.vaadin-flow' version '1.0.0.RC8'
}

repositories {
vaadin.repositories()
}

dependencies {
implementation project(":talepath-poc-1-backend")

implementation vaadin.core()
implementation vaadin.servletApi()
implementation vaadin.slf4j()

implementation "org.hibernate:hibernate-validator:5.4.1.Final"

implementation "org.vaadin.pekka:checkbox-group-java:1.0.0.alpha1"
implementation "javax.validation:validation-api:2.0.1.Final"
}

vaadin {
productionMode = true
}
talepath-poc-1-backend
dependencies {
implementation "javax.validation:validation-api:1.1.0.Final"
implementation "junit:junit:4.11"
}

但是,无论我将什么依赖项放入 talepath-poc-1-backend项目中,对于任何依赖项,它总是会失败,并且具有相同的异常
 Could not find method implementation() for arguments [*dependency*] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

虽然 talepath-poc-1-ui可以正常工作。问题是什么?

最佳答案

您仅在根项目中应用了java插件。

将其应用于所有子项目(我认为将其保留在根项目中是没有用的):

subprojects {
plugins {
id 'java'
}
}

关于gradle - 在子项目中找不到参数的方法实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54830054/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com