Baeldung / spring-security-oauth

Just Announced - "Learn Spring Security OAuth":
http://bit.ly/github-lsso
MIT License
1.99k stars 1.95k forks source link

keycloak-custom-providers | Issue with oauth-authorization-server dependency #450

Closed pcuriel closed 10 months ago

pcuriel commented 11 months ago

Hi,

I've come across an issue with the oauth-rest/keycloak-custom-providers project.

When trying to run ContextIntegrationTest, which launches AuthorizationServerApp from oauth-authorization-server project, AuthorizationServerApp class is not actually found.

The reason for this is that oauth-authorization-server is packaged using spring-boot-maven-plugin:

  <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    ...
  </plugin>

However, changing it to maven-jar-plugin, everything works as expected:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
  </plugin>

It would be nice to point this out in the project readme and/or in the related article.

ulisseslima commented 11 months ago

Hey, @pcuriel.

I'm not getting errors when running the command below without changing the Maven plugin:

mvn clean test -Dtest="ContextIntegrationTest"

Is this how you're building and running the class?

ulisseslima commented 10 months ago

Closed due to inactivity.

pablo-curiel commented 9 months ago

Sorry, I did not get notified about your responses.

Yes. I'm installing the oauth-authorization-server with: mvn clean install

And after that, running keycloak-custom-providers as you say (also tried running via the IDE). mvn clean test -Dtest="ContextIntegrationTest"

And unless I replace spring-boot-maven-plugin with maven-jar-plugin in oauth-authorization-server as I detail in my first post, the result is the following:

on project keycloak-custom-providers: Compilation failure: Compilation failure: 
[ERROR] .../src/test/java/com/baeldung/auth/provider/user/ContextIntegrationTest.java:[26,25] cannot find symbol
[ERROR]   symbol:   class AuthorizationServerApp
[ERROR]   location: package com.baeldung.auth