* disclaimer: this method has been copied from the DefaultRepositoryLayout of the Maven
* source tree and is Apache licensed. It was changed to use getBaseVersion() instead
* of getVersion() on the artifact.
*/
private static String pathOf(Artifact artifact) {
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
StringBuilder path = new StringBuilder();
path.append(formatAsDirectory(artifact.getGroupId())).append(PATH_SEPARATOR);
path.append(artifact.getArtifactId()).append(PATH_SEPARATOR);
path.append(artifact.getBaseVersion()).append(PATH_SEPARATOR);
// Lily change: Here we call getBaseVersion() instead of getVersion() because otherwise for snapshot artifacts
// a timestamp suffix is included in the version (and our shell scripts & runtime classloader.xml's
// refer to the plain snapshot version)
path.append(artifact.getArtifactId()).append(ARTIFACT_SEPARATOR).append(artifact.getBaseVersion());
if (artifact.hasClassifier()) {
path.append(ARTIFACT_SEPARATOR).append(artifact.getClassifier());
}
if (artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0) {
path.append(GROUP_SEPARATOR).append(artifactHandler.getExtension());
}
return path.toString();
}