I'me creating a TAF from scratch using Gradle and decided to make it multi-module. So I've created 'base-project' with build.gradle file looking like this:
plugins {
id 'java'
}
group 'com.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
// common dependencies for all modules
}
I've created 2 modules using IDE : testng-module and junit-module
So my base project's settings gradle file looks like this:
rootProject.name = 'base-project'
include 'testng-module'
include 'junit-module'
So for my junit module's build.gradle file looks like :
plugins {
id 'java'
}
group 'com.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation project(':base-project')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
test {
useJUnitPlatform()
}
But I've got an error:
A problem occurred evaluating project ':junit-module'.
Project with path ':base-project' could not be found in project ':junit-module'.
What can be the reason. I didn't create settings.gradle file for junit-module, because as I far as I understand it all project dependencies should be set in base project's settings.gradle file. I would also like to mention, that I created modules in IDE, not subprojects