@Override public ExtensionRepositoryId getId() { return new ExtensionRepositoryId(this.descriptor); }
/** * {@inheritDoc} * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj instanceof ExtensionRepositoryId) { ExtensionRepositoryId extensionId = (ExtensionRepositoryId) obj; return id.equals(extensionId.getId()) && type.equals(extensionId.getType()) && uri.equals(extensionId.getURI()); } return false; }
/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return toString().hashCode(); }
public AetherExtensionRepository(ExtensionRepositoryId repositoryId, RepositorySystemSession session, PlexusComponentManager mavenComponentManager) throws Exception { this.repositoryId = repositoryId; this.plexusComponentManager = mavenComponentManager; this.session = session; this.artifactDescriptorReader = this.plexusComponentManager.getPlexus().lookup(ArtifactDescriptorReader.class); this.remoteRepository = new RemoteRepository(repositoryId.getId(), "default", repositoryId.getURI().toString()); // FIXME: not very nice this.loadPomMethod = this.artifactDescriptorReader.getClass().getDeclaredMethod("loadPom", RepositorySystemSession.class, ArtifactDescriptorRequest.class, ArtifactDescriptorResult.class); this.loadPomMethod.setAccessible(true); }
public void addRepository(ExtensionRepositoryId repositoryId) throws ExtensionRepositoryException { try { ExtensionRepositoryFactory repositoryFactory = this.componentManager.lookup(ExtensionRepositoryFactory.class, repositoryId.getType()); addRepository(repositoryFactory.createRepository(repositoryId)); } catch (ComponentLookupException e) { throw new ExtensionRepositoryException("Unsupported repository type[" + repositoryId.getType() + "]", e); } }
private ExtensionRepositoryId parseRepository(String repositoryString) throws URISyntaxException { Matcher matcher = REPOSITORYIDPATTERN.matcher(repositoryString); if (matcher.matches()) { new ExtensionRepositoryId(matcher.group(1), matcher.group(2), new URI(matcher.group(3))); } // TODO: throw exception return null; } }
/** * @param id the repository identifier * @deprecated since 4.3M1 use {@link #AbstractExtensionRepository(ExtensionRepositoryDescriptor)} instead */ @Deprecated protected AbstractExtensionRepository(ExtensionRepositoryId id) { setId(new ExtensionRepositoryId(id)); }
/** * {@inheritDoc} * * @see org.xwiki.component.phase.Initializable#initialize() */ public void initialize() throws InitializationException { this.repositoryId = new ExtensionRepositoryId("core", "xwiki-core", null); loadExtensions(); }
@Override public Collection<ExtensionRepositoryId> getExtensionRepositories() { Collection<ExtensionRepositoryId> repositories = new ArrayList<ExtensionRepositoryId>(); for (ExtensionRepositoryDescriptor descriptor : getExtensionRepositoryDescriptors()) { repositories.add(new ExtensionRepositoryId(descriptor)); } return repositories; } }
@Override public Collection<ExtensionRepositoryId> getRepositories() { Collection<ExtensionRepositoryId> repositories = new ArrayList<ExtensionRepositoryId>(); for (ExtensionRepositoryDescriptor descriptor : getExtensionRepositoryDescriptors()) { repositories.add(new ExtensionRepositoryId(descriptor)); } return repositories; }
public List<ExtensionRepositoryId> getRepositories() { List<ExtensionRepositoryId> repositories = new ArrayList<ExtensionRepositoryId>(); List<String> repositoryStrings = this.configurationSource.getProperty("extension.repositories", Collections.<String> emptyList()); if (repositoryStrings != null && !repositoryStrings.isEmpty()) { for (String repositoryString : repositoryStrings) { try { ExtensionRepositoryId extensionRepositoryId = parseRepository(repositoryString); repositories.add(extensionRepositoryId); } catch (Exception e) { getLogger().warn("Faild to parse repository [" + repositoryString + "] from configuration", e); } } } else { try { repositories.add(new ExtensionRepositoryId("xwiki-releases", "maven", new URI( "http://maven.xwiki.org/releases/"))); repositories.add(new ExtensionRepositoryId("central", "maven", new URI("http://repo1.maven.org/maven2/"))); } catch (Exception e) { // Should never happen } } return repositories; }
public void initialize() throws InitializationException { this.rootFolder = this.configuration.getLocalRepository(); this.repositoryId = new ExtensionRepositoryId("local", "xwiki", this.rootFolder.toURI()); this.extensionSerializer = new DefaultLocalExtensionSerializer(this); loadExtensions(); }