diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..aac9b97 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +jar -tf bazel-bin/generate_workspace/generate_workspace_deploy.jar +cp bazel-bin/generate_workspace/generate_workspace_deploy.jar transitive_maven_jar diff --git a/generate_workspace/src/main/java/com/google/devtools/build/workspace/maven/VersionResolver.java b/generate_workspace/src/main/java/com/google/devtools/build/workspace/maven/VersionResolver.java index 14f52c6..c705505 100644 --- a/generate_workspace/src/main/java/com/google/devtools/build/workspace/maven/VersionResolver.java +++ b/generate_workspace/src/main/java/com/google/devtools/build/workspace/maven/VersionResolver.java @@ -17,6 +17,8 @@ import static com.google.devtools.build.workspace.maven.ArtifactBuilder.InvalidArtifactCoordinateException; import com.google.common.annotations.VisibleForTesting; + +import java.util.Collections; import java.util.List; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.resolution.VersionRangeResolutionException; @@ -69,9 +71,13 @@ String resolveVersion(String groupId, String artifactId, String versionSpec) */ private List requestVersionList(String groupId, String artifactId, String versionSpec) throws VersionRangeResolutionException, InvalidArtifactCoordinateException { - String transformedSpec = makeVersionRange(versionSpec); - Artifact artifact = ArtifactBuilder.fromCoords(groupId, artifactId, transformedSpec); - return aether.requestVersionRange(artifact); + if (isVersionRange(versionSpec)) { + String transformedSpec = makeVersionRange(versionSpec); + Artifact artifact = ArtifactBuilder.fromCoords(groupId, artifactId, transformedSpec); + return aether.requestVersionRange(artifact); + } else { + return Collections.singletonList(versionSpec); + } } /** diff --git a/transitive_maven_jar/generate_workspace_deploy.jar b/transitive_maven_jar/generate_workspace_deploy.jar index 40a3344..719f69f 100755 Binary files a/transitive_maven_jar/generate_workspace_deploy.jar and b/transitive_maven_jar/generate_workspace_deploy.jar differ