{"record":{"id":"ee0d09f16f91083e","repo":"quarkusio/quarkus","slug":"malformed-url-url","errorCode":null,"errorMessage":"Malformed URL: + url","messagePattern":"Malformed URL: \\+ url","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java","lineNumber":171,"sourceCode":"\n    private JavaVersion resolveProjectJavaVersion() {\n        TaskCollection<JavaCompile> compileTasks = project.getTasks().withType(JavaCompile.class);\n        if (compileTasks.isEmpty()) {\n            return JavaVersion.NA;\n        }\n        final JavaCompile task = compileTasks.iterator().next();\n        return new JavaVersion(task.getTargetCompatibility());\n    }\n\n    protected GradleMessageWriter messageWriter() {\n        return new GradleMessageWriter(getLogger());\n    }\n\n    protected static URL toURL(String url) {\n        try {\n            return new URL(url);\n        } catch (MalformedURLException e) {\n            throw new GradleException(\"Malformed URL:\" + url, e);\n        }\n    }\n\n}\n","sourceCodeStart":153,"sourceCodeEnd":176,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java#L153-L176","documentation":"toURL(String) converts a registry/endpoint URL string to a java.net.URL. If the string is not a well-formed URL (new URL throws MalformedURLException), it rethrows as GradleException(\"Malformed URL:\" + url). Note the actual message has no space after the colon despite the logged name.","triggerScenarios":"Passing a malformed quarkus.registry endpoint (missing scheme, illegal characters, typo like 'http:/host' or 'registry.quarkus.io' without protocol) into tasks that call toURL.","commonSituations":"Hand-edited registry endpoints in gradle.properties; YAML/property values with stray whitespace or quotes; missing 'https://' scheme; environment-specific overrides with broken values.","solutions":["Correct the URL string so it includes a valid scheme, e.g. https://registry.quarkus.io/maven.","Check for typos/whitespace/quotes in quarkus.registry properties in gradle.properties or environment variables.","Validate the URL by running new URL(value) in a quick script or curling the endpoint before configuring it."],"exampleFix":"// before (gradle.properties)\nquarkus.registry=registry.quarkus.io/maven\n\n// after\nquarkus.registry=https://registry.quarkus.io/maven","handlingStrategy":"validation","validationCode":"def url = providers.gradleProperty('quarkus.registry').getOrElse('https://registry.quarkus.io')\ntry { new java.net.URL(url.trim()) } catch (MalformedURLException e) { throw new IllegalArgumentException(\"Invalid quarkus.registry: \" + url) }","typeGuard":"static boolean isValidUrl(String s) {\n    try { new java.net.URL(s.trim()); return true } catch (MalformedURLException e) { return false }\n}","tryCatchPattern":"try { toURL(registryUrl) } catch (GradleException e) { if (e.message.startsWith('Malformed URL:')) { /* correct scheme in the URL property */ } }","preventionTips":["Always include the scheme (https://) in registry endpoint properties.","Trim whitespace and strip quotes when reading URLs from properties/env vars.","Lint quarkus.registry values in CI with a simple URL parse check."],"tags":["gradle","url","configuration","registry"],"backgroundTag":"malformed-url","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}