Skip to content

Java Module classloading issue using the maven resolver #1

@cmoulliard

Description

@cmoulliard

Issue

There is a Java Module classloading issue using the maven resolver and Quarkus:dev as command works using java -jar ...but fails withquarkus:dev`

java.lang.LinkageError: loader constraint violation: when resolving method 'void org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory.<init>(org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactorySelector)' the class loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @3a6bb9bf of the current class, org/eclipse/aether/supplier/RepositorySystemSupplier, and the class loader 'app' for the method's defining class, org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactory, have different Class objects for the type org/eclipse/aether/spi/connector/checksum/ChecksumAlgorithmFactorySelector used in the signature (org.eclipse.aether.supplier.RepositorySystemSupplier is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @3a6bb9bf, parent loader 'app'; org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory is in unnamed module of loader 'app') at org.eclipse.aether.supplier.RepositorySystemSupplier.getRepositoryLayoutFactories(RepositorySystemSupplier.java:223) at org.eclipse.aether.supplier.RepositorySystemSupplier.get(RepositorySystemSupplier.java:541)

The fix is to set the following property quarkus.class-loading.parent-first-artifacts=org.apache.maven.resolver:maven-resolver-supplier,org.apache.maven.resolver:maven-resolver-transport-file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions