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.internal; |
21 |
|
|
22 |
|
import java.net.URI; |
23 |
|
import java.util.ArrayList; |
24 |
|
import java.util.Collection; |
25 |
|
|
26 |
|
import javax.inject.Inject; |
27 |
|
import javax.inject.Named; |
28 |
|
import javax.inject.Singleton; |
29 |
|
|
30 |
|
import org.xwiki.component.annotation.Component; |
31 |
|
import org.xwiki.extension.ExtensionManagerConfiguration; |
32 |
|
import org.xwiki.extension.repository.AbstractExtensionRepositorySource; |
33 |
|
import org.xwiki.extension.repository.DefaultExtensionRepositoryDescriptor; |
34 |
|
import org.xwiki.extension.repository.ExtensionRepositoryDescriptor; |
35 |
|
import org.xwiki.extension.repository.aether.internal.NexusXWikiOrgExtensionRepositorySource; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@version |
41 |
|
@since |
42 |
|
|
43 |
|
@Component |
44 |
|
@Singleton |
45 |
|
@Named("default.snapshots") |
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
46 |
|
public class SnapshotsDefaultExtensionRepositorySource extends AbstractExtensionRepositorySource |
47 |
|
{ |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@Inject |
52 |
|
private ExtensionManagerConfiguration configuration; |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
1 |
@Override... |
55 |
|
public int getPriority() |
56 |
|
{ |
57 |
|
|
58 |
1 |
return NexusXWikiOrgExtensionRepositorySource.PRIORITY - 1; |
59 |
|
} |
60 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
61 |
1 |
@Override... |
62 |
|
public Collection<ExtensionRepositoryDescriptor> getExtensionRepositoryDescriptors() |
63 |
|
{ |
64 |
1 |
Collection<ExtensionRepositoryDescriptor> configuredRepositories = |
65 |
|
this.configuration.getExtensionRepositoryDescriptors(); |
66 |
|
|
67 |
1 |
Collection<ExtensionRepositoryDescriptor> newRepositories = new ArrayList<>(); |
68 |
|
|
69 |
1 |
if (configuredRepositories == null && !"true".equals(System.getProperty("skipSnapshotModules"))) { |
70 |
1 |
newRepositories.add(new DefaultExtensionRepositoryDescriptor("maven-xwiki-snapshot", "maven", |
71 |
|
URI.create("http://nexus.xwiki.org/nexus/content/groups/public-snapshots"))); |
72 |
|
} |
73 |
|
|
74 |
1 |
return newRepositories; |
75 |
|
} |
76 |
|
} |