1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.extension.repository.internal

File SnapshotsDefaultExtensionRepositorySource.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

2
6
2
1
76
38
4
0.67
3
2
2

Classes

Class Line # Actions
SnapshotsDefaultExtensionRepositorySource 46 6 0% 4 1
0.990%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
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    * Provides the XWiki snapshots repository as default maven repository.
39    *
40    * @version $Id: 6f8bfc0295b3ef951f18e40cbfba90865a3a164b $
41    * @since 6.2M1
42    */
43    @Component
44    @Singleton
45    @Named("default.snapshots")
 
46    public class SnapshotsDefaultExtensionRepositorySource extends AbstractExtensionRepositorySource
47    {
48    /**
49    * Used to get configuration properties containing repositories.
50    */
51    @Inject
52    private ExtensionManagerConfiguration configuration;
53   
 
54  1 toggle @Override
55    public int getPriority()
56    {
57    // Test snapshots repository just before release one to reduce loading on nexus.xwiki.org
58  1 return NexusXWikiOrgExtensionRepositorySource.PRIORITY - 1;
59    }
60   
 
61  1 toggle @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    }