maven_jar(): Clarify why 'SNAPSHOT' is discarded from directory name
Change-Id: Ic03082d418d118cf0395e667dd65ece4dce57c75
diff --git a/lib/maven.defs b/lib/maven.defs
index 67dad4e..d517de7 100644
--- a/lib/maven.defs
+++ b/lib/maven.defs
@@ -48,6 +48,12 @@
raise NameError('expected id="groupId:artifactId:version"')
group, artifact, version = parts
+ # SNAPSHOT artifacts are handled differently on Google storage bucket:
+ # 'SNAPSHOT' is discarded from the directory name. However on other
+ # Maven repositories, most notable local repository located in
+ # ~/.m2/repository (and is supported through MAVEN_LOCAL repository)
+ # it must be preserved, otherwise the artifact wouldn't be found.
+ # Atm the SNAPSHOT part is only discarded for Google storage bucket.
if 'SNAPSHOT' in version and repository.startswith(GERRIT):
file_version = version.replace('-SNAPSHOT', '')
version = version.split('-SNAPSHOT')[0] + '-SNAPSHOT'