Search code examples
spring-bootjerseyglassfishspring-jersey

Maven reports "bad path element" when building spring boot 3 with glassfish jersey


Building a Spring Boot 3.0.6 application with Jersey (version 3.1.1) gives a strange maven warning:

[path] bad path element "/home/rmuller/.m2/repository/org/glassfish/hk2/hk2/3.0.3/hk2-utils.jar": no such file or directory

This is correct, the right location is

/home/rmuller/.m2/repository/org/glassfish/hk2/hk2-utils/3.0.3/hk2-utils-3.0.3.jar

Where does this come from and how to fix it?

Remark 1: I know that i can suppress this warning. I want to know / understand what is the cause of this warning.

Remark 2: I cleansed my .m2 directory. No change. Maven dependencies:

  +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:3.1.1:compile
|  |  +- jakarta.inject:jakarta.inject-api:jar:2.0.1:compile
|  |  +- org.glassfish.jersey.core:jersey-common:jar:3.1.1:compile
|  |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.3:compile
|  |  \- jakarta.ws.rs:jakarta.ws.rs-api:jar:3.1.0:compile
|  +- org.glassfish.jersey.containers:jersey-container-servlet:jar:3.1.1:compile
|  +- org.glassfish.jersey.core:jersey-server:jar:3.1.1:compile
|  |  +- org.glassfish.jersey.core:jersey-client:jar:3.1.1:compile
|  |  \- jakarta.validation:jakarta.validation-api:jar:3.0.2:compile
|  +- org.glassfish.jersey.ext:jersey-bean-validation:jar:3.1.1:compile
|  |  \- org.jboss.logging:jboss-logging:jar:3.5.0.Final:compile
|  +- org.glassfish.jersey.ext:jersey-spring6:jar:3.1.1:compile
|  |  +- org.glassfish.jersey.inject:jersey-hk2:jar:3.1.1:compile
|  |  |  +- org.glassfish.hk2:hk2-locator:jar:3.0.3:compile
|  |  |  |  \- org.glassfish.hk2.external:aopalliance-repackaged:jar:3.0.3:compile
|  |  |  \- org.javassist:javassist:jar:3.29.0-GA:compile
|  |  +- org.glassfish.hk2:hk2:jar:3.0.3:compile
|  |  |  +- org.glassfish.hk2:hk2-utils:jar:3.0.3:compile
|  |  |  +- org.glassfish.hk2:hk2-api:jar:3.0.3:compile
|  |  |  +- org.glassfish.hk2:hk2-core:jar:3.0.3:compile
|  |  |  +- org.glassfish.hk2:hk2-runlevel:jar:3.0.3:compile
|  |  |  \- org.glassfish.hk2:class-model:jar:3.0.3:compile
|  |  |     +- org.ow2.asm:asm-analysis:jar:9.2:compile
|  |  |     +- org.ow2.asm:asm-commons:jar:9.2:compile
|  |  |     +- org.ow2.asm:asm-tree:jar:9.2:compile
|  |  |     \- org.ow2.asm:asm-util:jar:9.2:compile
|  |  \- org.glassfish.hk2:spring-bridge:jar:3.0.3:compile

Solution

  • This warning is caused by the Class-Path entry in MANIFEST.MF of hk2-<VERSION>.jar (org.glassfish.hk2:hk2:3.0.4).

    If this entry is removed, the warning disappears. Also see https://github.com/eclipse-ee4j/glassfish-hk2/issues/936.