Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
import org.junit.Assert;
import org.junit.Test;

/**
* Checks the content of the BOMs in this repository. When some artifacts are not available in Maven
* Central yet, use "-DdisableMavenCentralCheck=true" system property when running this test.
*/
public class BomContentTest {
private static VersionScheme versionScheme = new GenericVersionScheme();

Expand All @@ -66,9 +70,17 @@ public void testLibrariesBom() throws Exception {

private void checkBom(Path bomPath) throws Exception {
Bom bom = Bom.readBom(bomPath);

// Sometimes the artifacts are not yet available in Maven Central and only available in local
// Maven repository. Use this property in that case.
boolean disableMavenCentralCheck =
"true".equals(System.getProperty("disableMavenCentralCheck"));

List<Artifact> artifacts = bom.getManagedDependencies();
for (Artifact artifact : artifacts) {
assertReachable(buildMavenCentralUrl(artifact));
if (!disableMavenCentralCheck) {
for (Artifact artifact : artifacts) {
assertReachable(buildMavenCentralUrl(artifact));
}
}

assertNoDowngradeRule(bom);
Expand Down