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

Examples of org.sonatype.nexus.templates.repository.maven.Maven2ProxyRepositoryTemplate


  @Test(expected = RemoteStorageException.class)
  public void testInvalidRemoteUrl()
      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


      templates.add(new Maven2HostedRepositoryTemplate(this, DEFAULT_HOSTED_SNAPSHOT,
          "Maven2 (hosted, snapshot)",
          RepositoryPolicy.SNAPSHOT));

      templates.add(new Maven2ProxyRepositoryTemplate(this, DEFAULT_PROXY_RELEASE,
          "Maven2 (proxy, release)", RepositoryPolicy.RELEASE));

      templates.add(new Maven2ProxyRepositoryTemplate(this, DEFAULT_PROXY_SNAPSHOT,
          "Maven2 (proxy, snapshot)", RepositoryPolicy.SNAPSHOT));

      templates.add(new Maven1Maven2ShadowRepositoryTemplate(this, DEFAULT_VIRTUAL_M1_M2,
          "Maven1 to Maven2 (virtual)"));
View Full Code Here

    String repoId = "testSiteWithAuth";
    RepositoryRegistry repoRegistry = this.lookup(RepositoryRegistry.class);

    TemplateProvider templateProvider =
        this.lookup(TemplateProvider.class, DefaultRepositoryTemplateProvider.PROVIDER_ID);
    Maven2ProxyRepositoryTemplate template =
        (Maven2ProxyRepositoryTemplate) templateProvider.getTemplateById("default_proxy_release");
    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

Related Classes of org.sonatype.nexus.templates.repository.maven.Maven2ProxyRepositoryTemplate

Copyright © 2018 www.massapicom. 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.