Search in sources :

Example 21 with MavenVersion

use of aQute.bnd.version.MavenVersion in project bnd by bndtools.

the class MavenVersionTest method testDotsInQualifier.

public void testDotsInQualifier() {
    MavenVersion mv = MavenVersion.parseString("1.2.3.4.5");
    assertEquals(new Version(1, 2, 3, "4.5"), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
    mv = MavenVersion.parseString("1.2.3-4.5");
    assertEquals(new Version(1, 2, 3, "4.5"), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
    mv = MavenVersion.parseString("1.2-4.5");
    assertEquals(new Version(1, 2, 0, "4.5"), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
    mv = MavenVersion.parseString("1-4.5");
    assertEquals(new Version(1, 0, 0, "4.5"), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
}
Also used : MavenVersion(aQute.bnd.version.MavenVersion) Version(aQute.bnd.version.Version) MavenVersion(aQute.bnd.version.MavenVersion)

Aggregations

MavenVersion (aQute.bnd.version.MavenVersion)21 Version (aQute.bnd.version.Version)13 File (java.io.File)2 DefaultArtifact (org.eclipse.aether.artifact.DefaultArtifact)2 Archive (aQute.maven.api.Archive)1 Program (aQute.maven.api.Program)1 Revision (aQute.maven.api.Revision)1 ProgramMetadata (aQute.maven.provider.MetadataParser.ProgramMetadata)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 DefaultRepositorySystemSession (org.eclipse.aether.DefaultRepositorySystemSession)1 Artifact (org.eclipse.aether.artifact.Artifact)1 ArtifactRequest (org.eclipse.aether.resolution.ArtifactRequest)1 ArtifactResolutionException (org.eclipse.aether.resolution.ArtifactResolutionException)1 ArtifactResult (org.eclipse.aether.resolution.ArtifactResult)1 AbstractTransferListener (org.eclipse.aether.transfer.AbstractTransferListener)1 TransferCancelledException (org.eclipse.aether.transfer.TransferCancelledException)1 TransferEvent (org.eclipse.aether.transfer.TransferEvent)1