Skip to content

Commit 0f05b28

Browse files
committed
Update ExternalProvider.java
1 parent 7173dd7 commit 0f05b28

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

inject-generator/src/main/java/io/avaje/inject/generator/ExternalProvider.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package io.avaje.inject.generator;
22

3+
import static io.avaje.inject.generator.ProcessingContext.logDebug;
4+
import static io.avaje.inject.generator.ProcessingContext.logWarn;
5+
36
import java.util.Iterator;
47
import java.util.ServiceConfigurationError;
58
import java.util.ServiceLoader;
@@ -30,13 +33,17 @@ private static boolean moduleCP() {
3033

3134
static void registerModuleProvidedTypes(Set<String> providedTypes) {
3235
if (!injectAvailable) {
36+
logWarn(
37+
"Unable to detect Avaje Inject in Annotation Processor Class Path, use the Avaje Inject Maven/Gradle plugin for detecting external dependencies");
3338
return;
3439
}
3540

36-
Iterator<Module> iterator = ServiceLoader.load(Module.class, ExternalProvider.class.getClassLoader()).iterator();
41+
Iterator<Module> iterator =
42+
ServiceLoader.load(Module.class, ExternalProvider.class.getClassLoader()).iterator();
3743
while (iterator.hasNext()) {
3844
try {
39-
Module module = iterator.next();
45+
var module = iterator.next();
46+
logDebug("Loaded External Module %s", module.getClass().getCanonicalName());
4047
for (final Class<?> provide : module.provides()) {
4148
providedTypes.add(provide.getCanonicalName());
4249
}
@@ -61,6 +68,7 @@ static void registerPluginProvidedTypes(ScopeInfo defaultScope) {
6168
return;
6269
}
6370
for (final Plugin plugin : ServiceLoader.load(Plugin.class, Processor.class.getClassLoader())) {
71+
logDebug("Loaded Plugin %s", plugin.getClass().getCanonicalName());
6472
for (final Class<?> provide : plugin.provides()) {
6573
defaultScope.pluginProvided(provide.getCanonicalName());
6674
}

0 commit comments

Comments
 (0)