Package org.sonatype.nexus.templates.repository.maven

Examples of org.sonatype.nexus.templates.repository.maven.Maven2ProxyRepositoryTemplate.create()


      throws Exception
  {
    Maven2ProxyRepositoryTemplate t =
        (Maven2ProxyRepositoryTemplate) lookup(TemplateManager.class).getTemplate(RepositoryTemplate.class, "default_proxy_snapshot");
    t.getConfigurableRepository().setId("invalidUrlRepo");
    ProxyRepository r = t.create().adaptToFacet(ProxyRepository.class);
    r.setRemoteUrl("http://repository.sonatyp.org/content/repositories/snapshots");

    nexusConfiguration().saveConfiguration();

    indexerManager.reindexRepository("/", r.getId(), true);
View Full Code Here


    template.getCoreConfiguration().getConfiguration(true).setId(repoId);
    template.getCoreConfiguration().getConfiguration(true).setName(repoId + "-name");
    template.getCoreConfiguration().getConfiguration(true).setIndexable(false); // disable index
    template.getCoreConfiguration().getConfiguration(true).setSearchable(false); // disable index

    M2Repository m2Repo = (M2Repository) template.create();
    repoRegistry.addRepository(m2Repo);

    m2Repo.setRemoteUrl(remoteUrl);
    m2Repo.setRemoteAuthenticationSettings(new UsernamePasswordRemoteAuthenticationSettings("admin", "admin"));
    m2Repo.commitChanges();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.