ArtifacIdUtils { public static String toBaseId( Artifact artifact ) { String id = null; if ( artifact != null ) { id = toId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), artifact.getClassifier(), artifact.getBaseVersion() ); } return id; } private  ArtifacIdUtils(); static String toId( Artifact artifact ); static String toId( String groupId, String artifactId, String extension, String classifier, String version ); static String toBaseId( Artifact artifact ); static String toVersionlessId( Artifact artifact ); static String toVersionlessId( String groupId, String artifactId, String extension, String classifier );  }
@Test public void testToBaseIdArtifact() { Artifact artifact = null; assertSame( null, ArtifacIdUtils.toBaseId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "ext", "1.0-20110205.132618-23" ); assertEquals( "gid:aid:ext:1.0-SNAPSHOT", ArtifacIdUtils.toBaseId( artifact ) ); artifact = new DefaultArtifact( "gid", "aid", "cls", "ext", "1.0-20110205.132618-23" ); assertEquals( "gid:aid:ext:cls:1.0-SNAPSHOT", ArtifacIdUtils.toBaseId( artifact ) ); }