Examples of RepositoryTemplate


Examples of org.sonatype.nexus.templates.repository.RepositoryTemplate

  }

  protected ProxyRepository createProxyRepository()
      throws Exception
  {
    final RepositoryTemplate template =
        (RepositoryTemplate) getRepositoryTemplates().getTemplates(Maven2ContentClass.class,
            RepositoryPolicy.RELEASE, MavenProxyRepository.class).pick();
    final ConfigurableRepository templateConf = template.getConfigurableRepository();
    templateConf.setId("test");
    templateConf.setName("Test");
    final CRemoteStorage remoteStorageConf = new CRemoteStorage();
    remoteStorageConf.setUrl("http://localhost:" + server.getPort());
    template.getCoreConfiguration().getConfiguration(true).setRemoteStorage(remoteStorageConf);
    final MavenProxyRepository mavenProxyRepository = (MavenProxyRepository) template.create();

    return mavenProxyRepository;
  }
View Full Code Here

Examples of org.sonatype.nexus.templates.repository.RepositoryTemplate

    private Repository createFlexmojosRepository()
    {
        getLogger().info( "Default Flexmojos repository is missing, creating it." );
        try
        {
            RepositoryTemplate template =
                (RepositoryTemplate) templateProvider.getTemplateById( "default_proxy_release" );

            template.getConfigurableRepository().setId( "flexmojos" );
            template.getConfigurableRepository().setName( "Flexmojos Repository" );

            Repository repo = template.create();
            repositoryRegistry.addRepository( repo );

            return repo;
        }
        catch ( Exception e )
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.