From 3ef5bd8e3690c0d3e01d076a15d4c72812b0f6c1 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Wed, 3 Aug 2011 18:05:52 +0200 Subject: [PATCH] Read repository location from settings.xml --- _mvn | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/_mvn b/_mvn index 8e1d223..c780e47 100644 --- a/_mvn +++ b/_mvn @@ -415,9 +415,11 @@ _mvn_plugin_goal_properties() { (( $+functions[_mvn_groupIds] )) || _mvn_groupIds() { - # TODO Read repository location from settings/project - local repository_location=$HOME/.m2/repository ret=1 - + local settings_file repository_location ret=1 + + settings_file=${~opt_args[-s]:-${opt_args[--settings]:-$HOME/.m2/settings.xml}} + repository_location=${${${${(M)"$(<$settings_file)":#**}:-$HOME/.m2/repository}##*}%%<\/localRepository>*} + zstyle -s ":completion:${curcontext}:" cache-policy update_policy [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy