quarkusio/quarkus · error · GradleException

Failed to parse removed resource '

Error message

Failed to parse removed resource '

What it means

Thrown by ExtensionDescriptorTask.generateQuarkusExtensionProperties when an entry in quarkus.ext.removeResources (RemovedResource) has an artifactName that cannot be parsed as an ArtifactKey. ArtifactKey.fromString requires a valid G[A][:T] format, so malformed strings abort descriptor generation.

Source

Thrown at devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/tasks/ExtensionDescriptorTask.java:279

        }

        if (!quarkusExtensionConfiguration.getRequiredCapabilities().isEmpty()) {
            final StringBuilder buf = new StringBuilder();
            final Iterator<Capability> i = quarkusExtensionConfiguration.getRequiredCapabilities().iterator();
            appendCapability(i.next(), buf);
            while (i.hasNext()) {
                appendCapability(i.next(), buf.append(','));
            }
            props.setProperty(BootstrapConstants.PROP_REQUIRES_CAPABILITIES, buf.toString());
        }

        if (!quarkusExtensionConfiguration.getRemoveResources().isEmpty()) {
            for (RemovedResource removedResource : quarkusExtensionConfiguration.getRemoveResources()) {
                final ArtifactKey key;
                try {
                    key = ArtifactKey.fromString(removedResource.getArtifactName());
                } catch (IllegalArgumentException e) {
                    throw new GradleException(
                            "Failed to parse removed resource '" + removedResource.getArtifactName(), e);
                }
                if (removedResource.getRemovedResources().isEmpty()) {
                    continue;
                }
                final List<String> resources = removedResource.getRemovedResources();
                if (resources.size() == 0) {
                    continue;
                }
                final String value;
                if (resources.size() == 1) {
                    value = resources.get(0);
                } else {
                    final StringBuilder sb = new StringBuilder();
                    sb.append(resources.get(0));
                    for (int i = 1; i < resources.size(); ++i) {
                        final String resource = resources.get(i);
                        if (!resource.isBlank()) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix the artifactName string to a valid 'group:artifact' (or 'group:artifact:type:classifier') coordinate in build.gradle.
  2. Validate the coordinate locally (e.g. run with the exact string against ArtifactKey.fromString) before the build.
  3. Check that the configuration is not reading the artifact name from an incorrectly populated property (e.g. project name vs full coordinates).

Example fix

// before
removeResources {
  artifactName = 'my-artifact'
}
// after
removeResources {
  artifactName = 'io.quarkus.extension:my-artifact'
}/
Defensive patterns

Strategy: validation

Validate before calling

// validate the artifactName before configuring removeResources
def name = removedResource.artifactName
if (!(name ==~ /^[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+(:[A-Za-z0-9_.-]+){0,2}$/)) {
  throw new IllegalArgumentException("Invalid artifact coordinate: $name — expected 'group:artifact'")
}

Prevention

When it happens

Trigger: A RemovedResource in the extension plugin configuration block declares getArtifactName() as a string that fails ArtifactKey.fromString — e.g. missing group, empty string, or illegal characters.

Common situations: Typo in the quarkus { ext { removeResources { ... } } } block of an extension build.gradle, copying an example with placeholder coordinates, or forgetting the group when only an artifact name is given.

Understand the failure class

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/53b0fc70bc09b8ec. Report an issue: GitHub.