Skip to content

Commit 40349b2

Browse files
authored
chore: temporarily fix test to cater for maven cache issue (#6020)
* chore: temporarily fix test to cater for maven cache issue * include source code comment and fix syntax
1 parent 291545a commit 40349b2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/src/test/java/com/google/cloud/BomContentTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,22 @@ static void checkBomReachable(Path bomPath) throws Exception {
110110
}
111111

112112
private static String buildMavenCentralUrl(Artifact artifact) {
113+
// Due to a maven caching issue, accessing an artifact using the directory link (e.g
114+
// https://repo1.maven.org/maven2/com/google/cloud/google-cloud-bigtable/2.23.2)
115+
// results in a `404 Not Found` error even if the artifact is published but using a
116+
// nested file within the directory works (e.g.
117+
// https://repo1.maven.org/maven2/com/google/cloud/google-cloud-bigtable/2.23.2/google-cloud-bigtable-2.23.2.pom)
113118
return "https://repo1.maven.org/maven2/"
114119
+ artifact.getGroupId().replace('.', '/')
115120
+ "/"
116121
+ artifact.getArtifactId()
117122
+ "/"
118123
+ artifact.getVersion()
119-
+ "/";
124+
+ "/"
125+
+ artifact.getArtifactId()
126+
+ "-"
127+
+ artifact.getVersion()
128+
+ ".pom";
120129
}
121130

122131
/** Asserts that the BOM only provides JARs which contains unique class names to the classpath. */

0 commit comments

Comments
 (0)