[GRADLE-1900] Apply the repo location from the maven config in mavenLocal() Created: 08/Nov/11 Updated: 04/Jan/13 Resolved: 24/Feb/12
|Reporter:||Mike M.||Assignee:||Peter Niederwieser|
We have the situation where our CI server uses a custom maven localRepository location, configured in a settings.xml file in the conf subdirectory of the maven home dir. The Maven Ant Tasks, which we used before switching to Gradle, and which Gradle uses internally in the Maven plugin, read and apply the settings in this file. However, Gradle's mavenLocal() repository location does not.
So let's say I use the Maven Plugin's install task in Gradle project A and the mavenLocal() repository location in Gradle project B. Project B has an external dependency on artifacts from Project A. Project A will install its artifacts into the local repository configured in my $M2_HOME/conf/settings.xml file, whereas project B will always look them up in my ~/.m2/repository/ folder.
Since Gradle supports both directions, publishing and retrieving from Maven repositories out of the box, I think the behavior should be symmetrical here. It should just work without me having to manually specify repository locations in one of the two directions.
I've written a little workaround that mimics the behavior of the Maven Ant Tasks in looking up and applying the localRepository location from the maven config file locations:
|Comment by Mike M. [ 08/Nov/11 ]|
This issue is related to
|Comment by Peter Niederwieser [ 24/Feb/12 ]|
$M2_HOME/conf/settings.xml is now considered as well. Also, placeholders for system properties and environment variables in the repository path are resolved.