Examples of NexusMergeOperation


Examples of org.sonatype.nexus.proxy.maven.metadata.operations.NexusMergeOperation

      // do a merge if necessary
      if (existingMetadatas.size() > 1) {
        List<MetadataOperation> ops = new ArrayList<MetadataOperation>();

        for (int i = 1; i < existingMetadatas.size(); i++) {
          ops.add(new NexusMergeOperation(new MetadataOperand(existingMetadatas.get(i))));
        }

        final Collection<MetadataException> metadataExceptions =
            MetadataBuilder.changeMetadataIgnoringFailures(result, ops);
        if (metadataExceptions != null && !metadataExceptions.isEmpty()) {
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.metadata.operations.NexusMergeOperation

    Metadata result = existingMetadatas.get(0);

    List<MetadataOperation> ops = new ArrayList<MetadataOperation>();

    for (int i = 1; i < existingMetadatas.size(); i++) {
      ops.add(new NexusMergeOperation(new MetadataOperand(existingMetadatas.get(i))));
    }

    MetadataBuilder.changeMetadataIgnoringFailures(result, ops);

    return result;
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.metadata.operations.NexusMergeOperation

  {
    Metadata md1 = getSource(false);

    Metadata md2 = getTarget(false);

    NexusMergeOperation mergeOp = new NexusMergeOperation(new MetadataOperand(md1));
    mergeOp.perform(md2);

    validate(md2, false, false);
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.metadata.operations.NexusMergeOperation

  {
    Metadata md1 = getSource(false);

    Metadata md2 = getTarget(true);

    NexusMergeOperation mergeOp = new NexusMergeOperation(new MetadataOperand(md1));
    mergeOp.perform(md2);

    validate(md2, true, true);
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.metadata.operations.NexusMergeOperation

  {
    Metadata md1 = getSource(true);

    Metadata md2 = getTarget(false);

    NexusMergeOperation mergeOp = new NexusMergeOperation(new MetadataOperand(md1));
    mergeOp.perform(md2);

    validate(md2, true, false);
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.metadata.operations.NexusMergeOperation

  {
    Metadata md1 = getSource(true);

    Metadata md2 = getTarget(true);

    NexusMergeOperation mergeOp = new NexusMergeOperation(new MetadataOperand(md1));
    mergeOp.perform(md2);

    validate(md2, true, true);
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.metadata.operations.NexusMergeOperation

  public void testMergeReleaseAndSnapshot()
      throws Exception
  {
    Metadata release = getReleaseMetadata();
    Metadata snapshot = getSnapshotMetadata();
    NexusMergeOperation mergeOp = new NexusMergeOperation(new MetadataOperand(release));
    mergeOp.perform(snapshot);

    // check the snapshot metadata, which should now be merged
    assertThat(snapshot.getArtifactId(), equalTo("test"));
    assertThat(snapshot.getGroupId(), equalTo("test"));
    assertThat(snapshot.getPlugins(), empty());
    assertThat(snapshot.getVersion(), nullValue());
    assertThat(snapshot.getVersioning(), notNullValue());
    assertThat(snapshot.getVersioning().getLastUpdated(), equalTo("1234568"));
    assertThat(snapshot.getVersioning().getLatest(), equalTo("1.2-SNAPSHOT"));
    assertThat(snapshot.getVersioning().getRelease(), equalTo("1.1"));
    assertThat(snapshot.getVersioning().getSnapshot(), nullValue());
    assertThat(snapshot.getVersioning().getVersions(), notNullValue());
    assertThat(snapshot.getVersioning().getVersions(), containsInAnyOrder("1.1", "1.1-SNAPSHOT", "1.2-SNAPSHOT"));

    //now do the merge in reverse
    release = getReleaseMetadata();
    snapshot = getSnapshotMetadata();
    mergeOp = new NexusMergeOperation(new MetadataOperand(snapshot));
    mergeOp.perform(release);

    // check the release metadata, which should now be merged
    assertThat(release.getArtifactId(), equalTo("test"));
    assertThat(release.getGroupId(), equalTo("test"));
    assertThat(release.getPlugins(), empty());
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.