keycloak / keycloak-quickstarts

Apache License 2.0
1.98k stars 984 forks source link

Cannot build the examples, getting warnings and non solvable dependencies #619

Closed digger73 closed 2 weeks ago

digger73 commented 3 weeks ago

Describe the bug

I succeeded in building the extension/user-storage-simple by running mvn -Pextension clean compile However, I get the following warnings:

[WARNING] Some problems were encountered while building the effective model for org.keycloak.quickstarts:keycloak-user-storage-properties:jar:26.0.2
[WARNING] 'dependencies.dependency.scope' for org.keycloak.bom:keycloak-spi-bom:pom must be one of [provided, compile, runtime, test, system] but is 'import'. @ org.keycloak.quickstarts:keycloak-quickstart-parent:26.0.2, G:\Projects\KeycloakJava\keycloak-quickstarts\pom.xml, line 509, column 28

When trying to build the extension/user-storage-simple with the cmd in the readme mvn -Pextension clean install -DskipTests=true I get same warning as above, but furthermore gets the below errors:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.850 s
[INFO] Finished at: 2024-10-29T14:12:54+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project keycloak-user-storage-properties: Could not resolve dependencies for project org.keycloak.quickstarts:keycloak-user-storage-properties:jar:26.0.2
[ERROR] dependency: org.keycloak.quickstarts:keycloak-quickstarts-test-helper:jar:26.0.2 (test)
[ERROR]         org.keycloak.quickstarts:keycloak-quickstarts-test-helper:jar:26.0.2 was not found in https://repository.jboss.org/nexus/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of jboss has elapsed or updates are forced
[ERROR]         org.keycloak.quickstarts:keycloak-quickstarts-test-helper:jar:26.0.2 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
[ERROR] dependency: org.keycloak:keycloak-admin-client:jar:999.0.0-SNAPSHOT (test)
[ERROR]         Could not find artifact org.keycloak:keycloak-admin-client:jar:999.0.0-SNAPSHOT

Version

26.0.2

Expected behavior

Expectation is that using the cmd line described in the readme will compile the project as expected

Actual behavior

A build failure occurs when running the mvn -Pextension clean install -DskipTests=true according to the README in extension/user-storage-simpl.

[ERROR] Failed to execute goal on project keycloak-user-storage-properties: Could not resolve dependencies for project org.keycloak.quickstarts:keycloak-user-storage-properties:jar:26.0.2
[ERROR] dependency: org.keycloak.quickstarts:keycloak-quickstarts-test-helper:jar:26.0.2 (test)
[ERROR]         org.keycloak.quickstarts:keycloak-quickstarts-test-helper:jar:26.0.2 was not found in https://repository.jboss.org/nexus/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of jboss has elapsed or updates are forced
[ERROR]         org.keycloak.quickstarts:keycloak-quickstarts-test-helper:jar:26.0.2 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
[ERROR] dependency: org.keycloak:keycloak-admin-client:jar:999.0.0-SNAPSHOT (test)
[ERROR]         Could not find artifact org.keycloak:keycloak-admin-client:jar:999.0.0-SNAPSHOT

How to Reproduce?

Using: maven 3.9.9 Java 21.0.5 run the cmd mvn -Pextension clean install -DskipTests=true on the extension/user-storage-simple

Anything else?

No response

denis3509 commented 3 weeks ago

Same issue. Also tried to build 24 release, didn't work.

ubuntu 24.04 java 21.0.1 maven 3.8.7

djaybalaji commented 3 weeks ago

Got the same error with user-storage-jpa. Seems to be caused by some version mismatch with the recent upgrade to version 26.0.2. Keycloak-client still doesn't have version 26.0.2 so the pom.xml file uses version 999.0.0-SNAPSHOT which seems to be causing the issue

I manually changed the version numbers in pom.xml to 26.0.1 and I added a version number for jboss-logging. I also removed the quickstarts-test-helper dependency and I removed the ArquillianJpaStorageTest files and that seemed to fix it. This is a hacky solution for now and we need to wait till the team fixes the version numbers in the pom files.

There is probably a way to use 26.0.2 for everything except the client but I didn't try that option. The fix could be tried for user-storage-simple as well

image image

image

molnarp commented 2 weeks ago

To compound the build issues, keycloak-admin-client was renamed to keycloak-admin-client-tests.

https://github.com/keycloak/keycloak/commit/e5a4c94f75dce94fd7f7b11533d46636d94fcd34

stianst commented 2 weeks ago

Fixed in https://github.com/keycloak/keycloak-quickstarts/commit/34599b01eb1f195839cb6c0d7c0b85a2a3c83f46