首页 > 解决方案 > Keycloak-Admin-Client in a JPMS/Jigsaw Java 11 Maven application - Dependency Problems

问题描述

maybe someone has already figured that out or has some tips, I would be really thankful.

I'm trying to use the Keycloak-Admin-Client maven dependency in a modularized Java 11 application. The Application is modularized via JPMS/Jigsaw.

I'm using the version 9.0.2 of the Keycloak-Admin-Client.

<keycloak-admin-client.version>9.0.2</keycloak-admin-client.version>

<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>${keycloak-admin-client.version}</version>

My current Problem: java.lang.module.FindException: Module javax.ws.rs.api not found, required by com.fasterxml.jackson.jaxrs.base

But I already have this in my module-info and POM:

requires java.ws.rs;

    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
    </dependency>

The javax.ws.rs-api jar is also in my libs folder (module-path):

module-path lib folder

Some additional informations from the jackson-jaxrs-providers GitHub-Repo:

    requires static javax.ws.rs.api;
    requires static java.ws.rs;
    requires static jakarta.ws.rs.api;

https://github.com/FasterXML/jackson-jaxrs-providers/blob/master/json/src/moditect/module-info.java

I hope my problem is understandable, please ask if more details are needed.

Thanks a lot and best regards.

Pierre

标签: javamavenkeycloakjava-platform-module-system

解决方案


问题是 javax.ws.rs-api 工件版本 2.1 具有不同的工件 ID“java.ws.rs-api”而不是“javax.ws.rs-api”。

在 2.0.1 版中。是否缺少包裹。版本 2.1-m08 有效。

<dependency>
   <groupId>javax.ws.rs</groupId>
   <!-- pwi: JAX-RS 2.x has different artifact-id, "javax.ws.rs-api" and Version 2.0.1 has missing packages -->
   <artifactId>javax.ws.rs-api</artifactId>
   <version>2.1-m08</version>
</dependency>

推荐阅读