1 package org.apache.maven.resolver.examples.sisu;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import javax.inject.Inject;
23 import javax.inject.Named;
24 import javax.inject.Provider;
25
26 import org.apache.maven.model.building.DefaultModelBuilderFactory;
27 import org.apache.maven.model.building.ModelBuilder;
28 import org.eclipse.aether.RepositorySystem;
29 import org.eclipse.sisu.launch.Main;
30
31
32
33
34 @Named
35 public class SisuRepositorySystemFactory
36 {
37
38 @Inject
39 private RepositorySystem repositorySystem;
40
41 public static RepositorySystem newRepositorySystem()
42 {
43 return Main.boot( SisuRepositorySystemFactory.class ).repositorySystem;
44 }
45
46 @Named
47 private static class ModelBuilderProvider
48 implements Provider<ModelBuilder>
49 {
50
51 public ModelBuilder get()
52 {
53 return new DefaultModelBuilderFactory().newInstance();
54 }
55
56 }
57
58 }