diff --git a/validator-generator/src/main/java/io/avaje/validation/generator/ProcessingContext.java b/validator-generator/src/main/java/io/avaje/validation/generator/ProcessingContext.java index b1c9494e..ed284c58 100644 --- a/validator-generator/src/main/java/io/avaje/validation/generator/ProcessingContext.java +++ b/validator-generator/src/main/java/io/avaje/validation/generator/ProcessingContext.java @@ -28,13 +28,11 @@ private static final class Ctx { Ctx(ProcessingEnvironment env) { var elements = env.getElementUtils(); - this.injectPresent = elements.getTypeElement(Constants.COMPONENT) != null; this.warnHttp = elements.getTypeElement("io.avaje.http.api.Controller") != null; this.spiPresent = elements.getTypeElement("io.avaje.spi.internal.ServiceProcessor") != null; final var jakarta = elements.getTypeElement(Constants.SINGLETON_JAKARTA) != null; - diAnnotation = (injectPresent ? Constants.COMPONENT @@ -50,7 +48,6 @@ static void init(ProcessingEnvironment processingEnv) { } static FileObject createMetaInfWriterFor(String interfaceType) throws IOException { - var serviceFile = CTX.get().spiPresent ? interfaceType.replace("META-INF/services/", "META-INF/generated-services/") @@ -93,15 +90,9 @@ static void validateModule(String fqn) { && !moduleInfo.containsOnModulePath("io.avaje.validation.plugin"); if (noHttpPlugin) { - logWarn( - module, - "`requires io.avaje.validation.http` must be explicity added or else avaje-inject may fail to detect the default http validator, validator, and method AOP validator", - fqn); + logWarn(module, "`requires io.avaje.validation.http` must be explicity added or else avaje-inject may fail to detect the default http validator, validator, and method AOP validator", fqn); } else if (noInjectPlugin) { - logWarn( - module, - "`requires io.avaje.validation.plugin` must be explicity added or else avaje-inject may fail to detect the default validator and method AOP validator", - fqn); + logWarn(module, "`requires io.avaje.validation.plugin` must be explicity added or else avaje-inject may fail to detect the default validator and method AOP validator", fqn); } } catch (Exception e) { @@ -111,21 +102,18 @@ static void validateModule(String fqn) { } private static boolean buildPluginAvailable() { - return resource("target/avaje-plugin-exists.txt", "/target/classes") || resource("build/avaje-plugin-exists.txt", "/build/classes/java/main"); } private static boolean resource(String relativeName, String replace) { try (var inputStream = - new URI( - filer() - .getResource(StandardLocation.CLASS_OUTPUT, "", relativeName) - .toUri() - .toString() - .replace(replace, "")) - .toURL() - .openStream()) { + new URI(filer().getResource(StandardLocation.CLASS_OUTPUT, "", relativeName) + .toUri() + .toString() + .replace(replace, "")) + .toURL() + .openStream()) { return inputStream.available() > 0; } catch (IOException | URISyntaxException e) {