in tooling/common/src/main/java/org/apache/karaf/minho/tooling/common/maven/Parser.java [274:313]
private void parseArtifactPart( final String part )
throws MalformedURLException
{
String[] segments = part.split( ARTIFACT_SEPARATOR );
if( segments.length < 2 )
{
throw new MalformedURLException( "Invalid path. Syntax " + SYNTAX );
}
// we must have a valid group
m_group = segments[ 0 ];
if( m_group.trim().length() == 0 )
{
throw new MalformedURLException( "Invalid groupId. Syntax " + SYNTAX );
}
// valid artifact
m_artifact = segments[ 1 ];
if( m_artifact.trim().length() == 0 )
{
throw new MalformedURLException( "Invalid artifactId. Syntax " + SYNTAX );
}
// version is optional but we have a default value
m_version = VERSION_LATEST;
if( segments.length >= 3 && segments[ 2 ].trim().length() > 0 )
{
m_version = segments[ 2 ];
}
// type is optional but we have a default value
m_type = TYPE_JAR;
if( segments.length >= 4 && segments[ 3 ].trim().length() > 0 )
{
m_type = segments[ 3 ];
}
// classifier is optional (if not present or empty we will have a null classifier
m_fullClassifier = "";
if( segments.length >= 5 && segments[ 4 ].trim().length() > 0 )
{
m_classifier = segments[ 4 ];
m_fullClassifier = CLASSIFIER_SEPARATOR + m_classifier;
}
}