1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.extension.repository.aether.internal.components; |
21 |
|
|
22 |
|
import javax.inject.Inject; |
23 |
|
import javax.inject.Provider; |
24 |
|
import javax.inject.Singleton; |
25 |
|
|
26 |
|
import org.codehaus.plexus.ContainerConfiguration; |
27 |
|
import org.codehaus.plexus.DefaultContainerConfiguration; |
28 |
|
import org.codehaus.plexus.DefaultPlexusContainer; |
29 |
|
import org.codehaus.plexus.PlexusConstants; |
30 |
|
import org.codehaus.plexus.PlexusContainer; |
31 |
|
import org.codehaus.plexus.PlexusContainerException; |
32 |
|
import org.slf4j.Logger; |
33 |
|
import org.xwiki.component.annotation.Component; |
34 |
|
import org.xwiki.component.phase.Initializable; |
35 |
|
import org.xwiki.component.phase.InitializationException; |
36 |
|
|
37 |
|
|
38 |
|
@link |
39 |
|
|
40 |
|
@version |
41 |
|
@since |
42 |
|
|
43 |
|
@Component |
44 |
|
@Singleton |
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 3 |
Complexity Density: 0.38 |
|
45 |
|
public class PlexusContainerProvider implements Provider<PlexusContainer>, Initializable |
46 |
|
{ |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
@Inject |
51 |
|
private Logger logger; |
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
private DefaultPlexusContainer plexusContainer; |
57 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
58 |
25 |
@Override... |
59 |
|
public void initialize() throws InitializationException |
60 |
|
{ |
61 |
25 |
try { |
62 |
25 |
ContainerConfiguration config = new DefaultContainerConfiguration(); |
63 |
25 |
config.setAutoWiring(true); |
64 |
25 |
config.setClassPathScanning(PlexusConstants.SCANNING_INDEX); |
65 |
25 |
this.plexusContainer = new DefaultPlexusContainer(config); |
66 |
25 |
this.plexusContainer.setLoggerManager(new XWikiLoggerManager(this.logger)); |
67 |
|
} catch (PlexusContainerException e) { |
68 |
0 |
throw new InitializationException("Failed to initialize Maven", e); |
69 |
|
} |
70 |
|
} |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
71 |
@Override... |
73 |
|
public PlexusContainer get() |
74 |
|
{ |
75 |
71 |
return this.plexusContainer; |
76 |
|
} |
77 |
|
} |