the Java 11 maven application is modularized with JPMS/Jigsaw.
Problem 1: keycloak-spring-boot-2-adapter invalid module-name '2'
Solution 1: Renamed by maven plugin with removed "-2". But I'm not sure if this is a good solution.
<plugin>
<!-- for copying dependent libraries to folder lib -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>../lib</outputDirectory>
<excludeGroupIds>com.xyz</excludeGroupIds>
<excludeArtifactIds>keycloak-spring-boot-2-adapter</excludeArtifactIds>
</configuration>
</execution>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifacItem>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-boot-2-adapter</artifactId>
<overWrite>true</overWrite>
<outputDirectory>../lib</outputDirectory>
<destFileName>keycloak-spring-boot-adapter-9.0.2.jar</destFileName>
</artifacItem>
</artifactItems>
<!-- other configurations here -->
</configuration>
</execution>
</executions>
</plugin>
Problem 2: keycloak.spring.boot.adapter and keycloak.spring.boot.adapter.core have the same package name.
java.lang.module.ResolutionException: Modules keycloak.spring.boot.adapter and keycloak.spring.boot.adapter.core export package org.keycloak.adapters.springboot to module org.yaml.snakeyaml
Solution 2: ?
Thanks for your help and best regards,
Pierre