apache/maven · warning

The POM for {} is invalid, transitive dependencies (if any)

Error message

The POM for {} is invalid, transitive dependencies (if any) will not be available: {}

What it means

artifactDescriptorInvalid: while reading the dependency descriptor (POM) of a resolved artifact, the POM parsed but failed model validation. Maven keeps the artifact on the classpath but discards its dependency information, so transitive dependencies of that artifact silently disappear - usually surfacing later as NoClassDefFoundError/ClassNotFoundException at compile or runtime.

Source

Thrown at impl/maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java:93

            errorType = " is inaccessible";
        }

        String msg = "";
        if (exception != null) {
            msg = ": " + exception.getMessage();
        }

        if (logger.isDebugEnabled()) {
            logger.warn("The metadata {} {}{}", metadata, errorType, msg, exception);
        } else {
            logger.warn("The metadata {} {}{}", metadata, errorType, msg);
        }
    }

    @Override
    public void artifactDescriptorInvalid(RepositoryEvent event) {
        // The exception stack trace is not really interesting here
        logger.warn(
                "The POM for {} is invalid, transitive dependencies (if any) will not be available: {}",
                event.getArtifact(),
                event.getException().getMessage());
    }

    @Override
    public void artifactDescriptorMissing(RepositoryEvent event) {
        logger.warn("The POM for {} is missing, no dependency information available", event.getArtifact());
    }
}

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Run mvn dependency:tree -e -X to see the exact validation problem for the named artifact
  2. If you own the producer: fix its POM (often a missing parent or invalid elements), run mvn validate there, and redeploy
  3. Delete the cached copy in ~/.m2/repository and re-download in case a mirror corrupted it
  4. If the producer cannot be fixed: pin the dependency and explicitly declare the transitive dependencies you actually need

Example fix

<!-- before: relying on broken POM's missing transitive info -->
<dependency>
  <groupId>com.thirdparty</groupId>
  <artifactId>lib</artifactId>
  <version>1.2.3</version>
</dependency>
<!-- after: declare what the invalid POM would have provided -->
<dependency>
  <groupId>com.thirdparty</groupId>
  <artifactId>lib</artifactId>
  <version>1.2.3</version>
</dependency>
<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>32.1.3-jre</version>
</dependency>
Defensive patterns

Strategy: fallback

Validate before calling

// embedder/Resolver users: validate the descriptor eagerly with a listener
collector.setArtifactDescriptorPolicy((session, policy, e) -> {
    LOGGER.warn("Invalid POM for {}; declaring explicit deps as fallback", e.getArtifact());
    return true; // continue, but log/handle explicitly
});

Try / catch

try {
    resolved = system.resolveDependencies(session, request);
} catch (DependencyResolutionException e) {
    if (e.getCause() instanceof ArtifactDescriptorException) {
        // invalid POM: fall back to treating the artifact as dependency-less
        // and add its transitive deps explicitly
    } else { throw e; }
}

Prevention

When it happens

Trigger: A dependency's POM is malformed: invalid XML, references a parent that cannot be resolved, uses duplicate/invalid elements. The warn text carries the artifact coordinates plus the validation exception's getMessage().

Common situations: Third-party artifacts published with broken POMs; parent POMs that were never deployed alongside the child; a repository proxy mangling files; mixed old jvyaml/velocity-style POMs that fail newer model validation rules.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/51195d06a0270f83. Report an issue: GitHub.