Open LucasRouckhout opened 6 years ago
I have a multi-module project also, and the values in settings.xml
are not honored as well.
really unsure if this is the issue or not, but additional log messages may help to diagnose.
@LucasRouckhout @cwensel if you are using a multi-project build you need to apply the plugin (and configure it) on all subprojects, not just the root project. Something like this:
plugins {
id "net.linguica.maven-settings" version "0.5" apply false
}
allprojects {
apply plugin: "net.linguica.maven-settings"
mavenSettings {
userSettingsFileName "$System.env.HOME/.m2/settings.xml"
}
}
Long story short I use the maven-settings plugin so that I can instruct my gradle builld to use the repositories and credentials in the settings.xml file configured in the different Jenkins slaves we use. This works fine in single module projects but I have an issues with applying it to a multi module project.
I'm using gradle 4.6 and applying the plugin with the plugins block.
Running
./gradlew assemble
causes the first module to throw a:Cannot resolve external dependency ... because no repositories are defined.
for all my dependencies. These projects come from both in house nexus repo's and the maven central repository.I know this is a problem with the plugin since removing it and manually adding the repo's runs the build just fine. This is not an option though since I need the credentials in the
settings.xml
file for publishing artifacts.Am I being an idiot for missing something? Or have other people encountered the same issue.