@Test public void versionLevelMd() throws Exception { final Metadata m1 = v("org.foo", "some-project", "1.0.0", "20150324.121500", 3); final Metadata m2 = v("org.foo", "some-project", "1.0.0", "20150323.121500", 2); final Metadata m3 = v("org.foo", "some-project", "1.0.0", "20150322.121500", 1); 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("20150324121500")); assertThat(m.getVersioning().getSnapshot(), notNullValue()); assertThat(m.getVersioning().getSnapshot().getTimestamp(), equalTo("20150324.121500")); assertThat(m.getVersioning().getSnapshot().getBuildNumber(), equalTo(3)); }
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);  }