@Test public void artifactLevelMd() throws Exception { final Metadata m1 = a("org.foo", "some-project", "20150324121500", "1.0.1", "1.0.1", "1.0.0", "1.0.1"); final Metadata m2 = a("org.foo", "some-project", "20150324121700", "1.0.2", "1.0.2", "1.0.2"); final Metadata m3 = a("org.foo", "some-project", "20150324121600", "1.1.0-SNAPSHOT", null, "1.1.0-SNAPSHOT"); final Metadata m = merger.merge( ImmutableList.of(new Envelope("1", m1), new Envelope("2", m2), new Envelope("3", m3)) ); assertThat(m, notNullValue()); assertThat(m.getModelVersion(), equalTo("1.1.0")); assertThat(m.getGroupId(), equalTo("org.foo")); assertThat(m.getArtifactId(), equalTo("some-project")); assertThat(m.getVersioning().getLastUpdated(), equalTo("20150324121700")); assertThat(m.getVersioning().getSnapshot(), nullValue()); assertThat(m.getVersioning().getRelease(), equalTo("1.0.2")); assertThat(m.getVersioning().getLatest(), equalTo("1.1.0-SNAPSHOT")); assertThat(m.getVersioning().getVersions(), contains("1.0.0", "1.0.1", "1.0.2", "1.1.0-SNAPSHOT")); }
public void merge(final OutputStream outputStream, final MavenPath mavenPath, final Map<Repository, Content> contents) { log.debug("Merge metadata for {}", mavenPath.getPath()); List<Envelope> metadatas = new ArrayList<>(contents.size()); try { for (Map.Entry<Repository, Content> entry : contents.entrySet()) { addReadMetadata(mavenPath, metadatas, entry); } final Metadata mergedMetadata = merge(metadatas); if (mergedMetadata == null) { return; } MavenModels.writeMetadata(outputStream, mergedMetadata); } catch (IOException e) { log.error("Unable to merge {}", mavenPath, e); } }
RepositoryMetadataMerger extends ComponentSupport { public void merge(final OutputStream outputStream, final MavenPath mavenPath, final Map<Repository, Content> contents) { log.debug("Merge metadata for {}", mavenPath.getPath()); List<Envelope> metadatas = new ArrayList<>(contents.size()); try { for (Map.Entry<Repository, Content> entry : contents.entrySet()) { addReadMetadata(mavenPath, metadatas, entry); } final Metadata mergedMetadata = merge(metadatas); if (mergedMetadata == null) { return; } MavenModels.writeMetadata(outputStream, mergedMetadata); } catch (IOException e) { log.error("Unable to merge {}", mavenPath, e); } } }
RepositoryMetadataMerger extends ComponentSupport { public void merge(final OutputStream outputStream, final MavenPath mavenPath, final Map<Repository, Content> contents) { log.debug("Merge metadata for {}", mavenPath.getPath()); List<Envelope> metadatas = new ArrayList<>(contents.size()); try { for (Map.Entry<Repository, Content> entry : contents.entrySet()) { addReadMetadata(mavenPath, metadatas, entry); } final Metadata mergedMetadata = merge(metadatas); if (mergedMetadata == null) { return; } MavenModels.writeMetadata(outputStream, mergedMetadata); } catch (IOException e) { log.error("Unable to merge {}", mavenPath, e); } }  }
RepositoryMetadataMerger extends ComponentSupport { public void merge(final OutputStream outputStream, final MavenPath mavenPath, final Map<Repository, Content> contents) { log.debug("Merge metadata for {}", mavenPath.getPath()); List<Envelope> metadatas = new ArrayList<>(contents.size()); try { for (Map.Entry<Repository, Content> entry : contents.entrySet()) { addReadMetadata(mavenPath, metadatas, entry); } final Metadata mergedMetadata = merge(metadatas); if (mergedMetadata == null) { return; } MavenModels.writeMetadata(outputStream, mergedMetadata); } catch (IOException e) { log.error("Unable to merge {}", mavenPath, e); } }  void merge(final OutputStream outputStream,
                    final MavenPath mavenPath,
                    final Map<Repository, Content> contents); boolean metadataEquals(final Metadata md1, final Metadata md2); @Nullable Metadata merge(final Iterable<Envelope> metadatas); }
RepositoryMetadataMerger extends ComponentSupport { public void merge(final OutputStream outputStream, final MavenPath mavenPath, final Map<Repository, Content> contents) { log.debug("Merge metadata for {}", mavenPath.getPath()); List<Envelope> metadatas = new ArrayList<>(contents.size()); try { for (Map.Entry<Repository, Content> entry : contents.entrySet()) { addReadMetadata(mavenPath, metadatas, entry); } final Metadata mergedMetadata = merge(metadatas); if (mergedMetadata == null) { return; } MavenModels.writeMetadata(outputStream, mergedMetadata); } catch (IOException e) { log.error("Unable to merge {}", mavenPath, e); } }  void merge(final OutputStream outputStream,
                    final MavenPath mavenPath,
                    final Map<Repository, Content> contents); boolean metadataEquals(final Metadata md1, final Metadata md2); @Nullable Metadata merge(final Iterable<Envelope> metadatas);  }