3838
3939import aQute .bnd .build .Project ;
4040import aQute .bnd .build .Workspace ;
41+ import aQute .bnd .build .WorkspaceLayout ;
4142import aQute .bnd .memoize .Memoize ;
4243import aQute .bnd .service .RegistryPlugin ;
4344import aQute .bnd .service .RepositoryPlugin ;
@@ -56,6 +57,7 @@ public class RepositoryUtils {
5657 return tracker .orElse (null );
5758 }, Objects ::nonNull );
5859 }
60+
5961
6062 public static List <RepositoryPlugin > listRepositories (final Workspace localWorkspace , final boolean hideCache ) {
6163 if (localWorkspace == null ) {
@@ -74,11 +76,10 @@ public static List<RepositoryPlugin> listRepositories(final Workspace localWorks
7476// if ((bndWorkspace == localWorkspace) && !bndWorkspace.isDefaultWorkspace())
7577// repos.add(Central.getWorkspaceRepository());
7678
77- // if there is a cnf project (which is the marker for a bnd workspace)
78- // then we now show the WorkspaceRepository which contains all projects
7979 // TODO this is not perfect, because it is only working
80- // if you are selecting a bnd project
81- if (Central .hasWorkspaceDirectory () && !localWorkspace .isDefaultWorkspace () && !localWorkspace .getAllProjects ().isEmpty ()) {
80+ // if you are selecting a bnd project. Would be better if bnd WorkspaceRepository is added always
81+ // e.g. if there is at least one bnd project
82+ if (WorkspaceLayout .BND == localWorkspace .getLayout () && !localWorkspace .isDefaultWorkspace ()) {
8283 repos .add (localWorkspace .getWorkspaceRepository ());
8384 }
8485
0 commit comments