You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/11/11 19:54:14 UTC

[groovy] 02/03: GROOVY-8305: build "file:" URL for "user.home" and set as Ivy variable

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit e3caf95a13d1cb276aea6ec4000fe2218e2b4549
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Thu Nov 7 08:22:34 2019 -0600

    GROOVY-8305: build "file:" URL for "user.home" and set as Ivy variable
---
 src/main/groovy/groovy/grape/GrapeIvy.groovy      | 1 +
 src/resources/groovy/grape/defaultGrapeConfig.xml | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/groovy/groovy/grape/GrapeIvy.groovy b/src/main/groovy/groovy/grape/GrapeIvy.groovy
index f278298..a4bacf2 100644
--- a/src/main/groovy/groovy/grape/GrapeIvy.groovy
+++ b/src/main/groovy/groovy/grape/GrapeIvy.groovy
@@ -94,6 +94,7 @@ class GrapeIvy implements GrapeEngine {
         // start ivy
         Message.defaultLogger = new DefaultMessageLogger(System.getProperty('ivy.message.logger.level', '-1') as int)
         settings = new IvySettings()
+        settings.setVariable('user.home.url', new File(System.getProperty('user.home')).toURI().toURL() as String)
 
         // configure settings
         def grapeConfig = localGrapeConfig
diff --git a/src/resources/groovy/grape/defaultGrapeConfig.xml b/src/resources/groovy/grape/defaultGrapeConfig.xml
index 11161d3..14a180f 100644
--- a/src/resources/groovy/grape/defaultGrapeConfig.xml
+++ b/src/resources/groovy/grape/defaultGrapeConfig.xml
@@ -26,8 +26,8 @@
         <ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
         <artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]"/>
       </filesystem>
-      <ibiblio name="localm2" root="file:${user.home}/.m2/repository/" checkmodified="true" changingPattern=".*" changingMatcher="regexp" m2compatible="true"/>
-      <!-- todo add 'endorsed groovy extensions' resolver here -->
+      <ibiblio name="localm2" root="${user.home.url}/.m2/repository/" checkmodified="true" changingPattern=".*" changingMatcher="regexp" m2compatible="true"/>
+      <!-- TODO: add 'endorsed groovy extensions' resolver here -->
       <ibiblio name="jcenter" root="https://jcenter.bintray.com/" m2compatible="true"/>
       <ibiblio name="ibiblio" m2compatible="true"/>
     </chain>