use of aQute.maven.provider.MetadataParser.SnapshotVersion in project bnd by bndtools.
the class SnapshotReleaser method updateMetadata.
public void updateMetadata() throws Exception {
revisionMetadata.group = revision.group;
revisionMetadata.artifact = revision.artifact;
revisionMetadata.version = revision.version;
revisionMetadata.lastUpdated = programMetadata.lastUpdated;
revisionMetadata.snapshot.buildNumber = build;
revisionMetadata.snapshot.timestamp = dateStamp;
for (Archive archive : upload) {
SnapshotVersion snapshotVersion = new SnapshotVersion();
snapshotVersion.extension = archive.extension;
snapshotVersion.classifier = archive.classifier.isEmpty() ? null : archive.classifier;
snapshotVersion.updated = programMetadata.lastUpdated;
snapshotVersion.value = this.snapshotVersion;
revisionMetadata.snapshotVersions.add(snapshotVersion);
}
File metafile = home.toLocalFile(revision.metadata(repo.id));
IO.mkdirs(metafile.getParentFile());
IO.store(revisionMetadata.toString(), metafile);
repo.store(metafile, revision.metadata());
super.updateMetadata();
}
use of aQute.maven.provider.MetadataParser.SnapshotVersion in project bnd by bndtools.
the class MavenBackingRepository method getSnapshotArchives.
public List<Archive> getSnapshotArchives(Revision revision) throws Exception {
RevisionMetadata metadata = getMetadata(revision);
List<Archive> archives = new ArrayList<>();
for (SnapshotVersion snapshotVersion : metadata.snapshotVersions) {
Archive archive = revision.archive(snapshotVersion.value, snapshotVersion.extension, snapshotVersion.classifier);
archives.add(archive);
}
return archives;
}
use of aQute.maven.provider.MetadataParser.SnapshotVersion in project bnd by bndtools.
the class MetadataTest method testSnapshotParsing.
public void testSnapshotParsing() throws Exception {
try (InputStream in = new FileInputStream(IO.getFile("testresources/parser/commons-dbcp-1.4.1-SNAPSHOT.xml"))) {
RevisionMetadata parse = MetadataParser.parseRevisionMetadata(in);
assertNotNull(parse);
assertEquals("commons.dbcp", parse.group);
assertEquals("commons-dbcp", parse.artifact);
assertEquals(MavenVersion.parseString("1.4.1-SNAPSHOT"), parse.version);
assertNotNull(parse.snapshot);
assertEquals("13", parse.snapshot.buildNumber);
assertEquals("20140107.141700", parse.snapshot.timestamp);
assertEquals(10, parse.snapshotVersions.size());
SnapshotVersion snapshotVersion = parse.snapshotVersions.get(0);
assertNotNull(snapshotVersion);
assertEquals("bin", snapshotVersion.classifier);
assertEquals("tar.gz", snapshotVersion.extension);
assertEquals(MavenVersion.parseString("1.4.1-20140107.141700-13"), snapshotVersion.value);
assertEquals(1389104220000L, snapshotVersion.updated);
snapshotVersion = parse.snapshotVersions.get(9);
assertNotNull(snapshotVersion);
assertNull(snapshotVersion.classifier);
assertEquals("pom", snapshotVersion.extension);
assertEquals(MavenVersion.parseString("1.4.1-20140107.141700-13"), snapshotVersion.value);
assertEquals(1389104220000L, snapshotVersion.updated);
}
}
Aggregations