Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

could not find method implementation for arguments in subproject

Tags:

gradle

I have a multi-project build that looks like this

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"
}

But no matter what dependency I put into talepath-poc-1-backend project it always fails with the same exception for any dependency

 Could not find method implementation() for arguments [*dependency*] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

While talepath-poc-1-ui works fine. What is the problem?

like image 921
lapots Avatar asked Mar 21 '26 03:03

lapots


1 Answers

You have only applied your java plugin in the root project.

Apply it for all subprojects (I think it's useless for you to keep it in the root project) :

subprojects {
    plugins {
        id 'java'
    }
}
like image 185
ToYonos Avatar answered Mar 25 '26 00:03

ToYonos