Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong "optional" dependency in jakarta.websocket-api Maven artifact #461

Open
loetifuss opened this issue Nov 13, 2024 · 1 comment
Open

Comments

@loetifuss
Copy link

Since #180 the Maven artifact of jakarta.websocket-api lists jakarta.websocket-client-api as an optional "provided" dependency. With this setup the following code does not compile, although dependencies are defined correctly:

Compiling the following class:

import jakarta.websocket.server.ServerEndpointConfig;

public class Server {

    public String registerWebsocketEndpoint(ServerEndpointConfig serverEndpointConfig)
    {
        return serverEndpointConfig.getPath();
    }

}

with a dependency on:

dependencies {
    api 'jakarta.websocket:jakarta.websocket-api:2.2.0'
    // PROBLEM: this is needed to compile but should be included transitively
    // implementation 'jakarta.websocket:jakarta.websocket-client-api:2.2.0'
}

will fail with:

error: cannot access EndpointConfig
        return serverEndpointConfig.getPath();
                                   ^
  class file for jakarta.websocket.EndpointConfig not found

Either "jakarta.websocket-client-api" should be a transitive compile dependency or EndpointConfig should not be part of the "client-api" artifact since it is needed to compile server related classes.

I have attached a simple example reproducing the issue:
jakarta-websocket-dependencies.zip

@markt-asf
Copy link
Contributor

With the refactoring of the JAR contents to avoid duplication of classes, the issue described in #180 should no longer occur. Therefore, the fix is no longer required. EndpointConfig belongs in the client-api JAR so I think the fix here is to remove the provided scope so this becomes a default compile scope dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants