GradleGitDependenciesPlugin
GradleGitDependenciesPlugin copied to clipboard
Duplicate content roots detected
I'm trying to use this plugin in existing project and I've run into a problem with modules definition and dependencies.
settings.gradle
plugins {
id 'com.alexvasilkov.git-dependencies' version '2.0.4'
}
git {
dir "$rootDir/libraries"
cleanup false
}
include 'app'
include ':libraries:media-kit-android'
app/build.gradle
git {
implementation 'ssh://git@xyz/media-kit-android.git', {
branch 'origin/master'
}
}
dependencies {
implementation project(path: ':libraries:media-kit-android')
}
Building gradle files throws a warning:
Duplicate content roots detected Path [/xyz/libraries/media-kit-android] of module [project-name.media-kit-android] was removed from modules [project-name.libraries.media-kit-android]"
It looks like the plugin defines a module outside of libraries directory, which conflicts with a standard module definition in libraries subdirectory.
Is it possible to keep libraries
directory in the hierarchy?
You correctly noticed that the plugin automatically adds imported repos as sub modules, and it also adds these sub modules as dependencies to the current module. So you should remove include ':libraries:media-kit-android'
from settings.gradle
.
If you don't want sub-modules and module dependencies to be added automatically then you can just fetch remote repo and configure everything else manually. Check the readme to know more how to fetch repos from settings.gradle
.
OK, I see. However, we've just migrated to Kotlin DSL, so your plugin can't be used right now.