1212 *******************************************************************************/
1313package org .eclipse .m2e .bnd .ui ;
1414
15+ import java .io .File ;
16+ import java .util .ArrayList ;
17+ import java .util .Collection ;
1518import java .util .List ;
1619import java .util .Map ;
1720import java .util .Properties ;
1821
22+ import org .apache .maven .artifact .Artifact ;
1923import org .apache .maven .project .MavenProject ;
2024import org .eclipse .core .resources .IProject ;
2125import org .eclipse .core .runtime .AdapterTypes ;
2933import aQute .bnd .build .Project ;
3034import aQute .bnd .build .Workspace ;
3135import aQute .bnd .maven .lib .configuration .BeanProperties ;
36+ import aQute .bnd .maven .lib .resolve .ImplicitFileSetRepository ;
3237import aQute .bnd .osgi .Processor ;
3338
3439/**
@@ -60,12 +65,21 @@ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
6065 }
6166 }
6267 Processor processor = new Processor (processorProperties , false );
63-
68+ Collection <File > list = new ArrayList <File >();
69+ if (mp != null ) {
70+ for (Artifact artifact : mp .getArtifacts ()) {
71+ list .add (artifact .getFile ());
72+ }
73+ }
74+ ImplicitFileSetRepository repository = new ImplicitFileSetRepository ("Project Artifacts" , list );
6475 // TODO propertiesFile = new BndConfiguration(project,
6576 // mojoExecution).loadProperties(builder);
77+ // TODO
78+ // aQute.bnd.maven.lib.resolve.BndrunContainer.getFileSetRepository(MavenProject)
6679
6780 Workspace standaloneWorkspace = Workspace .createStandaloneWorkspace (processor ,
6881 mavenProject .getPomFile ().getParentFile ().toURI ());
82+ standaloneWorkspace .addBasicPlugin (repository );
6983 if (mp == null ) {
7084 standaloneWorkspace .set ("workspaceName" , mavenProject .getArtifactKey ().toPortableString ());
7185 } else {
@@ -76,6 +90,7 @@ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
7690 standaloneWorkspace .set ("workspaceDescription" , description );
7791 }
7892 }
93+ standaloneWorkspace .refresh ();
7994 Project bndProject = new Project (standaloneWorkspace , null , null );
8095 bndProject .setBase (null );
8196 return adapterType .cast (bndProject );
0 commit comments