You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2016/05/07 13:29:57 UTC

[04/50] [abbrv] maven-aether git commit: Bug 424822 - Ant tasks do not always respect maven.repo.local property

Bug 424822 - Ant tasks do not always respect maven.repo.local property

Evaluated maven.repo.local property when actually needed and not when the first Aether-related type gets loaded


Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/1e36b786
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/1e36b786
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/1e36b786

Branch: refs/heads/ant-tasks
Commit: 1e36b786b70d424d896cb91ba47a0294b95a396a
Parents: 5c663b9
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Thu Jan 2 21:21:17 2014 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Thu Jan 2 21:21:17 2014 +0100

----------------------------------------------------------------------
 .../java/org/eclipse/aether/ant/AntRepoSys.java | 25 ++++----------------
 1 file changed, 4 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-aether/blob/1e36b786/src/main/java/org/eclipse/aether/ant/AntRepoSys.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/eclipse/aether/ant/AntRepoSys.java b/src/main/java/org/eclipse/aether/ant/AntRepoSys.java
index 53860de..83bfedb 100644
--- a/src/main/java/org/eclipse/aether/ant/AntRepoSys.java
+++ b/src/main/java/org/eclipse/aether/ant/AntRepoSys.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2013 Sonatype, Inc.
+ * Copyright (c) 2010, 2014 Sonatype, Inc.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -125,8 +125,6 @@ public class AntRepoSys
 
     private Pom defaultPom;
 
-    private File mavenRepoDirFromProperty;
-
     private static <T> boolean eq( T o1, T o2 )
     {
         return ( o1 == null ) ? o2 == null : o1.equals( o2 );
@@ -174,22 +172,6 @@ public class AntRepoSys
         repos.setProject( project );
         repos.addRemoterepo( repo );
         project.addReference( Names.ID_DEFAULT_REPOS, repos );
-
-        // resolve maven.repo.local only once relative to project, as the basedir may change for <ant> tasks
-        String localRepoResolved = project.getProperty( "maven.repo.local.resolved" );
-        if ( localRepoResolved != null )
-        {
-            mavenRepoDirFromProperty = new File( localRepoResolved );
-        }
-        else
-        {
-            String mavenRepoProperty = project.getProperty( "maven.repo.local" );
-            if ( mavenRepoProperty != null )
-            {
-                mavenRepoDirFromProperty = project.resolveFile( mavenRepoProperty );
-                project.setProperty( "maven.repo.local.resolved", mavenRepoDirFromProperty.getAbsolutePath() );
-            }
-        }
     }
 
     public synchronized RepositorySystem getSystem()
@@ -322,9 +304,10 @@ public class AntRepoSys
 
     private File getDefaultLocalRepoDir()
     {
-        if ( mavenRepoDirFromProperty != null )
+        String dir = project.getProperty( "maven.repo.local" );
+        if ( dir != null )
         {
-            return mavenRepoDirFromProperty;
+            return project.resolveFile( dir );
         }
 
         Settings settings = getSettings();