diff --git a/sigil/bldcommon/sigil-repos.properties b/sigil/bldcommon/sigil-repos.properties
index b458ff4..db142d4 100644
--- a/sigil/bldcommon/sigil-repos.properties
+++ b/sigil/bldcommon/sigil-repos.properties
@@ -2,35 +2,29 @@
 
 # repository config
 
--repositories:  system, project, bld-ant, bld-common, felix, spring
+-repositories:  system, project, bld-common, felix, spring, bld-ant
 
 system;provider:        system
-system;level:           -1
 
 project;provider:       project
-project;level:  	0
 project;pattern:        \
 	${..}/common/**/[sigilproject] \
 	${..}/eclipse/**/[sigilproject] \
 
 bld-ant;provider:	filesystem
-bld-ant;level:	5
 bld-ant;recurse:	true
 bld-ant;dir:		${cache.dir:-${..}/cache}/ant/lib
 
 bld-common;provider:	filesystem
-bld-common;level:	2
 bld-common;recurse:	true
 bld-common;dir:		${cache.dir:-${..}/cache}/all
 
 felix;provider:	obr
-felix;level:		4
 felix;url:              http://felix.apache.org/obr/releases.xml 
 felix;index:            ${..}/build/felix.obr
 felix;cache:		${..}/build/obr-cache
 
 spring;provider:	obr
-spring;level:		4
 spring;url:             http://sigil.codecauldron.org/spring-external.obr
 spring;index:           ${..}/build/spring-external.obr
 spring;cache:		${..}/build/obr-cache
diff --git a/sigil/common/core/src/org/apache/felix/sigil/common/config/BldConfig.java b/sigil/common/core/src/org/apache/felix/sigil/common/config/BldConfig.java
index 499af0d..e43409e 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/common/config/BldConfig.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/common/config/BldConfig.java
@@ -36,6 +36,7 @@
     // control properties
     public static final String C_BUNDLES = "-bundles";
     public static final String C_REPOSITORIES = "-repositories";
+    public static final String C_REPOSITORY_PATH = "-repositorypath";
 
     // string properties
     public static final String S_ACTIVATOR = "-activator";
@@ -75,7 +76,7 @@
     private static final String MAPATTR_REGEX = ";\\s*";
     private static final String MAPATTR_SEP = ";";
     private static final String SUBKEY_SEP = ";";
-
+    
     // configuration is stored in typed maps
     private Map<String, String> string = new TreeMap<String, String>();
     private Map<String, List<String>> list = new TreeMap<String, List<String>>();
diff --git a/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java b/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java
index 705b2b9..0efcf6d 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java
@@ -36,6 +36,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -648,11 +649,19 @@
         return list;
     }
 
-    // Implement IBldConfig: getRepositoryConfig
-
+    public List<String> getRepositoryPath() 
+    {
+        List<String> ids = config.getList(null, BldConfig.C_REPOSITORY_PATH);
+        
+        if (ids.isEmpty())
+            return Collections.singletonList(IRepositoryConfig.WILD_CARD);
+        
+        return ids;
+    }
+    
     public Map<String, Properties> getRepositoryConfig()
     {
-        HashMap<String, Properties> map = new HashMap<String, Properties>();
+        LinkedHashMap<String, Properties> map = new LinkedHashMap<String, Properties>();
         BldProperties bp = new BldProperties(baseDir, bldOverrides);
 
         for (String name : config.getList(null, BldConfig.C_REPOSITORIES))
diff --git a/sigil/common/core/src/org/apache/felix/sigil/common/config/IRepositoryConfig.java b/sigil/common/core/src/org/apache/felix/sigil/common/config/IRepositoryConfig.java
index 39beab2..319ce7d 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/common/config/IRepositoryConfig.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/common/config/IRepositoryConfig.java
@@ -19,18 +19,26 @@
 
 package org.apache.felix.sigil.common.config;
 
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
 public interface IRepositoryConfig
 {
     static final String REPOSITORY_PROVIDER = "provider";
-    static final String REPOSITORY_LEVEL = "level";
+    static final String WILD_CARD = "*";
+    
+    /**
+     * Return the ordered list of repositories to search
+     * for dependencies.
+     * 
+     * @return
+     */
+    List<String> getRepositoryPath();
 
     /**
      * get properties with which to instantiate repositories.
      * The key REPOSITORY_PROVIDER will be set to the fully qualified class name of the IRepositoryProvider.
-     * The key REPOSITORY_LEVEL indicates repository search order.
      * @return
      */
     Map<String, Properties> getRepositoryConfig();
diff --git a/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java b/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java
index 28d3e36..fc8d3dd 100644
--- a/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java
+++ b/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java
@@ -21,6 +21,9 @@
 
 import java.io.File;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -43,78 +46,123 @@
             "org.apache.felix.sigil.common.core.repository.SystemRepositoryProvider");
     };
 
-    private Map<String, Properties> repos;
+    private final Map<String, Properties> repos;
+    private final List<String> repositoryPath;
 
-    public BldRepositoryManager(Map<String, Properties> repos)
+    public BldRepositoryManager(List<String> repositoryPath, Map<String, Properties> repos)
     {
+        System.out.println("RepositoryPath=" + repositoryPath);
+        System.out.println("Repos=" + repos);
+        this.repositoryPath = repositoryPath;
         this.repos = repos;
     }
 
     @Override
     protected void loadRepositories()
     {
-        for (String name : repos.keySet())
+        scanRepositories(repositoryPath, repos, 0);
+    }
+
+    /**
+     * @param repos2 
+     * @param repositoryPath2
+     */
+    private int scanRepositories(List<String> repositoryPath, Map<String, Properties> repos, int start)
+    {
+        int count = start;
+        for (String name : repositoryPath)
         {
-            Properties repo = repos.get(name);
-            if (Boolean.parseBoolean(repo.getProperty("disabled", "false")))
-            {
-                continue;
-            }
-
-            String optStr = repo.getProperty("optional", "false");
-            boolean optional = Boolean.parseBoolean(optStr.trim());
-
-            String alias = repo.getProperty(IRepositoryConfig.REPOSITORY_PROVIDER);
-            if (alias == null)
-            {
-                Log.error("provider not specified for repository: " + name);
-                continue;
-            }
-
-            String provider = (aliases.containsKey(alias) ? aliases.get(alias) : alias);
-
-            if (alias.equals("obr"))
-            {
-                // cache is directory where synchronized bundles are stored;
-                // not needed in ivy.
-                repo.setProperty("cache", "/no-cache");
-                String index = repo.getProperty("index");
-
-                if (index == null)
-                {
-                    // index is created to cache OBR url
-                    File indexFile = new File(System.getProperty("java.io.tmpdir"),
-                        "obr-index-" + name);
-                    indexFile.deleteOnExit();
-                    repo.setProperty("index", indexFile.getAbsolutePath());
-                }
-                else
-                {
-                    if (!new File(index).getParentFile().mkdirs())
-                    {
-                        // ignore - but keeps findbugs happy
+            System.out.println("Building repository for " + name);
+            if ( IRepositoryConfig.WILD_CARD.equals(name) ) {
+                HashSet<String> defined = new HashSet<String>();
+                for (String n : repositoryPath) {
+                    if (!IRepositoryConfig.WILD_CARD.equals(n)) {
+                        defined.add(n);
                     }
                 }
+                List<String> path = new LinkedList<String>();
+                for (String key : repos.keySet()) {
+                    if (!defined.contains(key))
+                    {
+                        path.add(key);
+                    }
+                }
+                count = scanRepositories(path, repos, start + 1);
             }
-
-            int level = Integer.parseInt(repo.getProperty(
-                IRepositoryConfig.REPOSITORY_LEVEL,
-                Integer.toString(IBundleRepository.NORMAL_PRIORITY)));
-
-            try
-            {
-                IRepositoryProvider instance = (IRepositoryProvider) (Class.forName(provider).newInstance());
-                IBundleRepository repository = instance.createRepository(name, repo);
-                addRepository(repository, level);
-                Log.verbose("added repository: " + repository + " : " + level);
-            }
-            catch (Exception e)
-            {
-                String msg = "failed to create repository: ";
-                if (!optional)
-                    throw new Error(msg + repo + " " + e, e);
-                System.err.println("WARNING: " + msg + e);
+            else {
+                Properties props = repos.get(name);
+                IBundleRepository repo = buildRepository(name, props);
+                System.out.println("Built repository " + repo + " for " + name + " at " + count);
+                
+                if ( repo != null ) {
+                    addRepository(repo, count++);
+                }                
             }
         }
+        
+        return count;
+    }
+
+    /**
+     * @param repo
+     * @return 
+     */
+    private static IBundleRepository buildRepository(String name, Properties repo)
+    {
+        String optStr = repo.getProperty("optional", "false");
+        boolean optional = Boolean.parseBoolean(optStr.trim());
+
+        String alias = repo.getProperty(IRepositoryConfig.REPOSITORY_PROVIDER);
+        if (alias == null)
+        {
+            String msg = "provider not specified for repository: " + name;
+            
+            if (!optional)
+                throw new IllegalStateException(msg);
+            
+            Log.warn(msg);
+        }
+
+        String provider = (aliases.containsKey(alias) ? aliases.get(alias) : alias);
+
+        if (alias.equals("obr"))
+        {
+            // cache is directory where synchronized bundles are stored;
+            // not needed in ivy.
+            repo.setProperty("cache", "/no-cache");
+            String index = repo.getProperty("index");
+
+            if (index == null)
+            {
+                // index is created to cache OBR url
+                File indexFile = new File(System.getProperty("java.io.tmpdir"),
+                    "obr-index-" + name);
+                indexFile.deleteOnExit();
+                repo.setProperty("index", indexFile.getAbsolutePath());
+            }
+            else
+            {
+                if (!new File(index).getParentFile().mkdirs())
+                {
+                    // ignore - but keeps findbugs happy
+                }
+            }
+        }
+
+        try
+        {
+            IRepositoryProvider instance = (IRepositoryProvider) (Class.forName(provider).newInstance());
+            IBundleRepository repository = instance.createRepository(name, repo);
+            return repository;
+        }
+        catch (Exception e)
+        {
+            String msg = "failed to create repository: ";
+            if (!optional)
+                throw new IllegalStateException(msg + repo + " " + e, e);
+            Log.warn(msg + e);
+        }
+        
+        return null;
     }
 }
\ No newline at end of file
diff --git a/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldResolver.java b/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldResolver.java
index 1e33b66..99dad6d 100644
--- a/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldResolver.java
+++ b/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldResolver.java
@@ -19,6 +19,7 @@
 
 package org.apache.felix.sigil.ivy;
 
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -32,9 +33,11 @@
 
 public class BldResolver implements IBldResolver
 {
-    private Map<String, Properties> repos;
-    private BldRepositoryManager manager;
+    private final Map<String, Properties> repos;
+    private final List<String> repositoryPath;
 
+    private BldRepositoryManager manager;
+    
     static
     {
         try
@@ -48,8 +51,9 @@
         }
     };
 
-    public BldResolver(Map<String, Properties> repos)
+    public BldResolver(List<String> repositoryPath, Map<String, Properties> repos)
     {
+        this.repositoryPath = repositoryPath;
         this.repos = repos;
     }
 
@@ -86,7 +90,7 @@
     {
         if (manager == null)
         {
-            manager = new BldRepositoryManager(repos);
+            manager = new BldRepositoryManager(repositoryPath, repos);
         }
 
         IResolutionMonitor ivyMonitor = new IResolutionMonitor()
diff --git a/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java b/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java
index 6404ef9..7fbd2d7 100644
--- a/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java
+++ b/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/SigilResolver.java
@@ -30,6 +30,7 @@
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.jar.JarEntry;
@@ -37,6 +38,7 @@
 import java.util.jar.Manifest;
 
 import org.apache.felix.sigil.common.config.BldFactory;
+import org.apache.felix.sigil.common.config.IRepositoryConfig;
 import org.apache.felix.sigil.common.model.IModelElement;
 import org.apache.felix.sigil.common.model.ModelElementFactory;
 import org.apache.felix.sigil.common.model.eclipse.ISigilBundle;
@@ -120,8 +122,10 @@
                     uri = cwd.resolve(config);
                 }
 
-                Map<String, Properties> repositories = BldFactory.getConfig(uri).getRepositoryConfig();
-                resolver = new BldResolver(repositories);
+                IRepositoryConfig project = BldFactory.getConfig(uri);
+                List<String> repositoryPath = project.getRepositoryPath(); 
+                Map<String, Properties> repositories = project.getRepositoryConfig();
+                resolver = new BldResolver(repositoryPath, repositories);
             }
             catch (IOException e)
             {
