in src/main/java/org/apache/maven/plugins/help/DescribeMojo.java [349:381]
private PluginInfo parsePluginLookupInfo() throws MojoFailureException {
PluginInfo pi = new PluginInfo();
if (plugin != null && !plugin.isEmpty()) {
if (plugin.indexOf(':') > -1) {
String[] pluginParts = plugin.split(":");
switch (pluginParts.length) {
case 1:
pi.setPrefix(pluginParts[0]);
break;
case 2:
pi.setGroupId(pluginParts[0]);
pi.setArtifactId(pluginParts[1]);
break;
case 3:
pi.setGroupId(pluginParts[0]);
pi.setArtifactId(pluginParts[1]);
pi.setVersion(pluginParts[2]);
break;
default:
throw new MojoFailureException("plugin parameter must be a plugin prefix,"
+ " or conform to: 'groupId:artifactId[:version]'.");
}
} else {
pi.setPrefix(plugin);
}
} else {
pi.setGroupId(groupId);
pi.setArtifactId(artifactId);
pi.setVersion(version);
}
return pi;
}