Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SNAPSHOT suffix in version number (#914) #915

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion private/rules/v2_lock_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ def _compute_lock_file_hash(lock_file_contents):
return hash(repr(to_hash))

def _to_m2_path(unpacked):
path = "{group}/{artifact}/{version}/{artifact}-{version}".format(
# For maven release repositoty, the path is {group}/{artifact}/{version}/{artifact}-{version}
# For maven snapshot repository, the path is {group}/{artifact}/{version with SNAPSHOT}/{artifact}-{version without SNAPSHOT}-{timestamp}-{buildNumber}
path = "{group}/{artifact}/{version}/{artifact}-{stripped_version}".format(
artifact = unpacked["artifactId"],
group = unpacked["groupId"].replace(".", "/"),
version = unpacked["version"],
stripped_version = unpacked["version"].replace("-SNAPSHOT", "")
)

classifier = unpacked.get("scope", "jar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ private Map<Coordinates, Coordinates> deriveCoordinateMappings(Map<String, Objec
file, coord));
}
String version = pathSubstring.substring(0, index);
if (version.endsWith("-SNAPSHOT")) {
version = version.substring(0, version.length()-9);
}

// After the version, there should be nothing left but a file name
pathSubstring = pathSubstring.substring(version.length() + 1);
Expand Down
Binary file modified private/tools/prebuilt/lock_file_converter_deploy.jar
Binary file not shown.