in maven-3.0.x/src/main/java/org/sonatype/aether/util/artifact/DefaultArtifact.java [91:114]
public DefaultArtifact( String coords, Map<String, String> properties )
{
Pattern p = Pattern.compile( "([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)" );
Matcher m = p.matcher( coords );
if ( !m.matches() )
{
throw new IllegalArgumentException( "Bad artifact coordinates"
+ ", expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>" );
}
groupId = m.group( 1 );
artifactId = m.group( 2 );
extension = get( m.group( 4 ), "jar" );
classifier = get( m.group( 6 ), "" );
version = m.group( 7 );
file = null;
if ( properties != null && !properties.isEmpty() )
{
this.properties = new HashMap<String, String>( properties );
}
else
{
this.properties = Collections.emptyMap();
}
}