Package org.sonatype.nexus.proxy.maven.maven2

Examples of org.sonatype.nexus.proxy.maven.maven2.M2Repository.commitChanges()


    assertThat(new File(repoLocation, ".nexus/trash"), FileMatchers.isDirectory());

    M2Repository outOfServiceRepo =
        (M2Repository) this.lookup(RepositoryRegistry.class).getRepository("out-of-service-repo");
    outOfServiceRepo.setLocalStatus(LocalStatus.OUT_OF_SERVICE);
    outOfServiceRepo.commitChanges();

    Wastebasket wastebasket = this.lookup(Wastebasket.class);
    wastebasket.purgeAll(1L);

    // NEXUS-4642 check if directories were deleted
View Full Code Here


    FileUtils.copyDirectory(trashContent, basketDir);

    M2Repository outOfServiceRepo =
        (M2Repository) this.lookup(RepositoryRegistry.class).getRepository("out-of-service-repo");
    outOfServiceRepo.setLocalStatus(LocalStatus.OUT_OF_SERVICE);
    outOfServiceRepo.commitChanges();

    Wastebasket wastebasket = this.lookup(Wastebasket.class);
    wastebasket.purgeAll(DefaultWastebasket.ALL);

    assertThat(basketDir, FileMatchers.isDirectory());
View Full Code Here

        assertThat(payload.getData().getPublishedUrl(), containsString(".meta/prefixes.txt"));
        assertThat(payload.getData().getPublishedUrl(), containsString(REPO_ID));
      }

      repository.setExposed(false);
      repository.commitChanges();

      {
        final RoutingStatusMessageWrapper payload = wlStatusResource.get(null, request, null, null);
        assertThat(payload, is(notNullValue()));
        assertThat(payload.getData().getPublishedUrl(), is(nullValue()));
View Full Code Here

        assertThat(payload, is(notNullValue()));
        assertThat(payload.getData().getPublishedUrl(), is(nullValue()));
      }

      repository.setExposed(true);
      repository.commitChanges();

      {
        final RoutingStatusMessageWrapper payload = wlStatusResource.get(null, request, null, null);
        assertThat(payload, is(notNullValue()));
        assertThat(payload.getData().getPublishedUrl(), is(notNullValue()));
View Full Code Here

  {
    // put repo2 out of service
    String repoId = "repo2";
    M2Repository repo = (M2Repository) repositoryRegistry.getRepository(repoId);
    repo.setLocalStatus(LocalStatus.OUT_OF_SERVICE);
    repo.commitChanges();

    TestWalkerProcessor wp = null;
    WalkerContext wc = null;

    wp = new TestWalkerProcessor();
View Full Code Here

  public void testWithoutPreparedContext()
      throws Exception
  {
    final M2Repository repository = createRepository("test");
    repository.setIndexable(false);
    repository.commitChanges();
    repositoryRegistry.addRepository(repository); // need to be in registry to hand it over to indexerManager
    prepareNexusIndexer(nexusIndexer, repository); // indexerManager creates context for it
    try {
      final ArchetypeContentGenerator archetypeContentGenerator =
          new ArchetypeContentGenerator(lookup(MacPlugin.class), (DefaultIndexerManager) indexerManager,
View Full Code Here

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

    m2Repo.setRemoteUrl(remoteUrl);
    m2Repo.setRemoteAuthenticationSettings(new UsernamePasswordRemoteAuthenticationSettings("admin", "admin"));
    m2Repo.commitChanges();

    Reference rootRef = new Reference("http://localhost:8081/nexus/service/local/repositories/" + repoId + "");
    Reference resourceRef =
        new Reference(rootRef, "http://localhost:8081/nexus/service/local/repositories/" + repoId + "/");
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.