diff --git a/mpcdf_common.py b/mpcdf_common.py
index d351382df3f0066f591d69d5161146d9ab71bb4f..3ca1420db1a43c95a436d25f7a4e2f6899cf80e2 100644
--- a/mpcdf_common.py
+++ b/mpcdf_common.py
@@ -665,10 +665,10 @@ Macros:
             p.set("repository", repo)
             p.tail = "\n    "
 
-        if parent and name != "System":
-            path(parent, name)
         for dep_project, dep_repo in dependencies:
             path(dep_project, dep_repo)
+        if parent and name != "System":
+            path(parent, name)
 
         for arch in architectures:
             a = ElementTree.SubElement(r, "arch")