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

Regression: EE 10 Platform API JARs include transitive dependencies to Spec API JARs leading to duplicate classes #583

Closed
lprimak opened this issue Dec 4, 2022 · 1 comment

Comments

@lprimak
Copy link

lprimak commented Dec 4, 2022

Describe the bug
This is a regression from Jakarta EE 8 (possibly 9)

Platform API JARs should not include the Spec JARs as transitive dependencies, as seen below.
The leads to duplicate classes on the classpath and problems
if an application uses has JPMS module-info anywhere (split package issues)

% mvnd dependency:tree
[INFO] --- maven-dependency-plugin:3.4.0:tree (default-cli) @ hope-website ---
[INFO] +- jakarta.platform:jakarta.jakartaee-api:jar:10.0.0:provided
[INFO] |  +- jakarta.platform:jakarta.jakartaee-web-api:jar:10.0.0:provided
[INFO] |  |  +- jakarta.servlet:jakarta.servlet-api:jar:6.0.0:provided
[INFO] |  |  +- jakarta.servlet.jsp:jakarta.servlet.jsp-api:jar:3.1.0:provided
[INFO] |  |  +- jakarta.el:jakarta.el-api:jar:5.0.1:provided
[INFO] |  |  +- jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:jar:3.0.0:provided
[INFO] |  |  +- jakarta.faces:jakarta.faces-api:jar:4.0.1:provided
[INFO] |  |  +- jakarta.websocket:jakarta.websocket-api:jar:2.1.0:provided
[INFO] |  |  +- jakarta.websocket:jakarta.websocket-client-api:jar:2.1.0:provided
[INFO] |  |  +- jakarta.ejb:jakarta.ejb-api:jar:4.0.1:provided
[INFO] |  |  +- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:provided
[INFO] |  |  +- jakarta.persistence:jakarta.persistence-api:jar:3.1.0:provided
[INFO] |  |  +- jakarta.validation:jakarta.validation-api:jar:3.0.2:provided
[INFO] |  |  +- jakarta.interceptor:jakarta.interceptor-api:jar:2.1.0:provided
[INFO] |  |  +- jakarta.enterprise:jakarta.enterprise.lang-model:jar:4.0.1:provided
[INFO] |  |  +- jakarta.inject:jakarta.inject-api:jar:2.0.1:provided
[INFO] |  |  +- jakarta.authentication:jakarta.authentication-api:jar:3.0.0:provided
[INFO] |  |  \- jakarta.security.enterprise:jakarta.security.enterprise-api:jar:3.0.0:provided
[INFO] |  +- jakarta.jms:jakarta.jms-api:jar:3.1.0:provided
[INFO] |  +- jakarta.activation:jakarta.activation-api:jar:1.2.2:provided
[INFO] |  +- jakarta.mail:jakarta.mail-api:jar:2.1.0:provided
[INFO] |  +- jakarta.resource:jakarta.resource-api:jar:2.1.0:provided
[INFO] |  +- jakarta.authorization:jakarta.authorization-api:jar:2.1.0:provided
[INFO] |  \- jakarta.batch:jakarta.batch-api:jar:2.1.1:provided

To Reproduce
Steps to reproduce the behavior:

        <dependency>
            <groupId>jakarta.platform</groupId>
            <artifactId>jakarta.jakartaee-api</artifactId>
            <version>10.0.0</version>
            <scope>provided</scope>
        </dependency>

Workaround
The issue can be worked around by excluding all transitive dependencies:

        <dependency>
            <groupId>jakarta.platform</groupId>
            <artifactId>jakarta.jakartaee-api</artifactId>
            <version>10.0.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Possible Solution
I think you can make the Spic JARs <optional>true</optional> to solve this problem
Currently, it is set to false, not sure what's the reason for that.

@lprimak
Copy link
Author

lprimak commented Dec 6, 2022

This issue has been moved to jakartaee/jakartaee-api#133

@lprimak lprimak closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2022
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

1 participant