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 @@ -31,6 +31,8 @@
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.stream.Collectors;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.inject.ConfigProperty;
Expand Down Expand Up @@ -166,6 +168,8 @@ private BuildTimeConfigurationReader(ClassLoader classLoader, final List<Class<?
runTimeMappings = new ArrayList<>();

Map<Class<?>, GroupDefinition> groups = new HashMap<>();
Set<String> legacyConfigRoots = new TreeSet<>();

for (Class<?> configRoot : configRoots) {
boolean isMapping = configRoot.isAnnotationPresent(ConfigMapping.class);
if (isMapping) {
Expand Down Expand Up @@ -220,6 +224,17 @@ private BuildTimeConfigurationReader(ClassLoader classLoader, final List<Class<?
assert phase == ConfigPhase.RUN_TIME;
runTimeRoots.add(definition);
}

if (configRoot.getAnnotation(Deprecated.class) == null) {
legacyConfigRoots.add(configRoot.getName());
}
}

if (!legacyConfigRoots.isEmpty()) {
log.warn(
"The following config roots are using the legacy configuration classes infrastructure and should be adjusted to use an interface and @ConfigMapping.\n"
+ "See https://quarkus.io/guides/writing-extensions#configuration for more information. Please report this issue to their respective owners.\n\n"
+ legacyConfigRoots.stream().collect(Collectors.joining("\n- ", "- ", "")));
}

// ConfigRoots
Expand Down
Loading