Could not find method compile() for arguments project

0

Kiedy chcę zbudować projekt w gradle wywala mi błąd

Could not find method compile() for arguments [project ':common'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.



org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':core'.
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':core'.
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method compile() for arguments [project ':common'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
    at build_7ik97bgumtntdjoan6kma2j39$_run_closure1.doCall(C:\Users\Jonatan\Documents\GitHub\REST-Web-Services\core\build.gradle:6)
    at build_7ik97bgumtntdjoan6kma2j39.run(C:\Users\Jonatan\Documents\GitHub\REST-Web-Services\core\build.gradle:1)

tak wygląda w skrócie moduł główny dla projektu

def javaProjects = subprojects.findAll {
	it.name == "common" & it.name == "core" && it.name == "web"
}

allprojects {
	apply plugin: 'idea'
	apply plugin: 'eclipse'

	repositories {
		jcenter()
	}
}

configure(javaProjects) {
	apply plugin: 'java'
	apply plugin: 'org.springframework.boot'
	apply plugin: 'io.spring.dependency-management'

	sourceCompatibility = 1.8
	targetCompatibility = 1.8

	dependencies {
		...
        }
}

moduł core, gdzie wyrzucany jest błąd

group = 'com.core'


dependencies {
	/*******************************
	 * Compile Dependencies
	 *******************************/

	compile project(":common") // tutaj właśnie jest błąd compile()
...
}

a tak moduł common

group = 'com.common'

apply plugin: "java-library"

dependencies {...}

I właśnie w module core gradle wyrzuca błąd na compile project(":common"). Dlaczego tak się dzieje?

1
def javaProjects = subprojects.findAll {
    it.name == "common" & it.name == "core" && it.name == "web"
}

Brakuje jednego znaku &, sprawdź czy jak poprawisz nadal występuje błąd.

0

Strzał w dziesiątkę. Działa. Dzięki.

1 użytkowników online, w tym zalogowanych: 0, gości: 1