Skip to content
Closed
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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Red Hat and others
* Copyright (c) 2021, 2022 Red Hat and others
*
* This program and the accompanying materials are made available under the
* Apache Software License 2.0 which is available at:
Expand Down Expand Up @@ -45,10 +45,15 @@ private static void discoverFactories() {
Comparator.comparingInt(BuildServices::getPriority).reversed());

ServiceLoader<BuildServices> loader = SecurityActions.loadService(
BuildServices.class, Thread.currentThread().getContextClassLoader());

if (!loader.iterator().hasNext()) {
loader = SecurityActions.loadService(
BuildServices.class, BuildServicesResolver.class.getClassLoader());
}

if (!loader.iterator().hasNext()) {
throw new IllegalStateException("Unable to locate AnnotationBuilderFactory implementation");
throw new IllegalStateException("Unable to locate BuildServices implementation");
}

try {
Expand Down