Skip to content
Merged
Show file tree
Hide file tree
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 @@ -15,7 +15,6 @@
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
import javax.tools.Diagnostic.Kind;

import org.jboss.jdeparser.JDeparser;
Expand Down Expand Up @@ -54,12 +53,7 @@ public synchronized void init(ProcessingEnvironment processingEnv) {

ExtensionModule extensionModule = utils.extension().getExtensionModule();

Config config = new Config(extensionModule, useConfigMapping, debug);

if (!useConfigMapping) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Extension module " + extensionModule.artifactId()
+ " config implementation is deprecated. Please migrate to use @ConfigMapping: https://quarkus.io/guides/writing-extensions#configuration");
}
Config config = new Config(extensionModule, debug);

List<ExtensionProcessor> extensionProcessors = new ArrayList<>();
extensionProcessors.add(new ExtensionBuildProcessor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ public boolean equals(Object obj) {
return Objects.equals(artifactId, other.artifactId) && Objects.equals(groupId, other.groupId);
}

// TODO #42114 remove once fixed
@Deprecated(forRemoval = true)
@JsonIgnore
public boolean isMixedModule() {
return "io.quarkus".equals(groupId) && ("quarkus-core".equals(artifactId) || "quarkus-vertx-http".equals(artifactId));
}

@JsonIgnore
public Extension normalizeCommonOrInternal() {
if (!commonOrInternal()) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,9 @@ public ConfigAnnotationScanner(Config config, Utils utils) {
List<ConfigAnnotationListener> configRootListeners = new ArrayList<>();
List<ConfigAnnotationListener> configMappingWithoutConfigRootListeners = new ArrayList<>();

if (!config.getExtension().isMixedModule()) {
// This is what we aim for. We have an exception for Quarkus Core and Quarkus Messaging though.
if (config.useConfigMapping()) {
configRootListeners.add(new JavadocConfigMappingListener(config, utils, configCollector));
configRootListeners.add(new ConfigMappingListener(config, utils, configCollector));

configMappingWithoutConfigRootListeners.add(new JavadocConfigMappingListener(config, utils, configCollector));
} else {
configRootListeners.add(new JavadocLegacyConfigRootListener(config, utils, configCollector));
configRootListeners.add(new LegacyConfigRootListener(config, utils, configCollector));
}
} else {
// TODO #42114 remove once fixed
// we handle both traditional config roots and config mappings
if (config.getExtension().isMixedModule()) {
configRootListeners.add(new JavadocConfigMappingListener(config, utils, configCollector));
configRootListeners.add(new JavadocLegacyConfigRootListener(config, utils, configCollector));
configRootListeners.add(new ConfigMappingListener(config, utils, configCollector));
configRootListeners.add(new LegacyConfigRootListener(config, utils, configCollector));

configMappingWithoutConfigRootListeners.add(new JavadocConfigMappingListener(config, utils, configCollector));
}
}
configRootListeners.add(new JavadocConfigMappingListener(config, utils, configCollector));
configRootListeners.add(new ConfigMappingListener(config, utils, configCollector));
configMappingWithoutConfigRootListeners.add(new JavadocConfigMappingListener(config, utils, configCollector));

this.configRootListeners = Collections.unmodifiableList(configRootListeners);
this.configMappingWithoutConfigRootListeners = Collections.unmodifiableList(configMappingWithoutConfigRootListeners);
Expand Down Expand Up @@ -481,28 +461,10 @@ private <T extends DiscoveryRootElement> T applyRootListeners(
}

private void checkConfigRootAnnotationConsistency(TypeElement configRoot) {
// for now quarkus-core is a mix of both @ConfigRoot and @ConfigMapping
// see https://github.com/quarkusio/quarkus/issues/42114
// same for Quarkus Messaging
// TODO #42114 remove once fixed
if (config.getExtension().isMixedModule()) {
return;
}

if (config.useConfigMapping()) {
if (!utils.element().isAnnotationPresent(configRoot, Types.ANNOTATION_CONFIG_MAPPING)) {
throw new IllegalStateException(
"This module is configured to use @ConfigMapping annotations but we found a @ConfigRoot without a corresponding @ConfigMapping annotation in: "
+ configRoot + "."
+ " Either add the annotation or add the -AlegacyConfigRoot=true argument to the annotation processor config in the pom.xml");
}
} else {
if (utils.element().isAnnotationPresent(configRoot, Types.ANNOTATION_CONFIG_MAPPING)) {
throw new IllegalStateException(
"This module is configured to use legacy @ConfigRoot annotations but we found a @ConfigMapping annotation in: "
+ configRoot + "."
+ " Check the configuration of the annotation processor and drop the -AlegacyConfigRoot=true argument from the pom.xml if needed");
}
if (!utils.element().isAnnotationPresent(configRoot, Types.ANNOTATION_CONFIG_MAPPING)) {
throw new IllegalStateException(
"We found a @ConfigRoot without a corresponding @ConfigMapping annotation in: " + configRoot + "."
+ " Make sure your configuration interfaces are annotated with @ConfigMapping.");
}
}

Expand Down
Loading
Loading