quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.34k stars 2.55k forks source link

javax.annotation excludes spreaded across multiple modules instead of centralized approach in BOM #26468

Open rsvoboda opened 2 years ago

rsvoboda commented 2 years ago

Describe the bug

javax.annotation excludes spreaded across multiple modules instead of centralized approach in BOM

Noticed this when preparing https://github.com/quarkusio/quarkus/pull/26347

I think the excludes should be managed in the BOM and not across individual extensions

javax.annotation excludes outside the BOM

build-parent/pom.xml-                <exclusions>
build-parent/pom.xml-                    <exclusion>
build-parent/pom.xml:                        <groupId>javax.annotation</groupId>
build-parent/pom.xml-                        <artifactId>javax.annotation-api</artifactId>
build-parent/pom.xml-                    </exclusion>
--
core/runtime/pom.xml-                </exclusion>
core/runtime/pom.xml-                <exclusion>
core/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
core/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
core/runtime/pom.xml-                </exclusion>
--
extensions/grpc-common/runtime/pom.xml-                </exclusion>
extensions/grpc-common/runtime/pom.xml-                <exclusion>
extensions/grpc-common/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/grpc-common/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/grpc-common/runtime/pom.xml-                </exclusion>
--
extensions/grpc/protoc/pom.xml-            <exclusions>
extensions/grpc/protoc/pom.xml-                <exclusion>
extensions/grpc/protoc/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/grpc/protoc/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/grpc/protoc/pom.xml-                </exclusion>
--
extensions/infinispan-client/runtime/pom.xml-            <exclusions>
extensions/infinispan-client/runtime/pom.xml-                <exclusion>
extensions/infinispan-client/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/infinispan-client/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/infinispan-client/runtime/pom.xml-                </exclusion>
--
extensions/kubernetes-client/spi/pom.xml-            <exclusions>
extensions/kubernetes-client/spi/pom.xml-                <exclusion>
extensions/kubernetes-client/spi/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/kubernetes-client/spi/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/kubernetes-client/spi/pom.xml-                </exclusion>
--
extensions/openshift-client/runtime/pom.xml-            <exclusions>
extensions/openshift-client/runtime/pom.xml-                <exclusion>
extensions/openshift-client/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/openshift-client/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/openshift-client/runtime/pom.xml-                </exclusion>
--
extensions/smallrye-fault-tolerance/runtime/pom.xml-                </exclusion>
extensions/smallrye-fault-tolerance/runtime/pom.xml-                <exclusion>
extensions/smallrye-fault-tolerance/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/smallrye-fault-tolerance/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/smallrye-fault-tolerance/runtime/pom.xml-                </exclusion>
--
extensions/smallrye-reactive-messaging-amqp/runtime/pom.xml-                </exclusion>
extensions/smallrye-reactive-messaging-amqp/runtime/pom.xml-                <exclusion>
extensions/smallrye-reactive-messaging-amqp/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/smallrye-reactive-messaging-amqp/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/smallrye-reactive-messaging-amqp/runtime/pom.xml-                </exclusion>
--
extensions/smallrye-reactive-messaging-kafka/runtime/pom.xml-                </exclusion>
extensions/smallrye-reactive-messaging-kafka/runtime/pom.xml-                <exclusion>
extensions/smallrye-reactive-messaging-kafka/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/smallrye-reactive-messaging-kafka/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/smallrye-reactive-messaging-kafka/runtime/pom.xml-                </exclusion>
--
extensions/smallrye-reactive-messaging-mqtt/runtime/pom.xml-                </exclusion>
extensions/smallrye-reactive-messaging-mqtt/runtime/pom.xml-                <exclusion>
extensions/smallrye-reactive-messaging-mqtt/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/smallrye-reactive-messaging-mqtt/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/smallrye-reactive-messaging-mqtt/runtime/pom.xml-                </exclusion>
--
extensions/smallrye-reactive-messaging-rabbitmq/runtime/pom.xml-                </exclusion>
extensions/smallrye-reactive-messaging-rabbitmq/runtime/pom.xml-                <exclusion>
extensions/smallrye-reactive-messaging-rabbitmq/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/smallrye-reactive-messaging-rabbitmq/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/smallrye-reactive-messaging-rabbitmq/runtime/pom.xml-                </exclusion>
--
extensions/smallrye-reactive-messaging/runtime/pom.xml-                </exclusion>
extensions/smallrye-reactive-messaging/runtime/pom.xml-                <exclusion>
extensions/smallrye-reactive-messaging/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/smallrye-reactive-messaging/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/smallrye-reactive-messaging/runtime/pom.xml-                </exclusion>
--
extensions/smallrye-reactive-messaging/runtime/pom.xml-                </exclusion>
extensions/smallrye-reactive-messaging/runtime/pom.xml-                <exclusion>
extensions/smallrye-reactive-messaging/runtime/pom.xml:                    <groupId>javax.annotation</groupId>
extensions/smallrye-reactive-messaging/runtime/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
extensions/smallrye-reactive-messaging/runtime/pom.xml-                </exclusion>
--
extensions/undertow/runtime/pom.xml-                </exclusion>
extensions/undertow/runtime/pom.xml-                <exclusion>
extensions/undertow/runtime/pom.xml:                    <groupId>org.jboss.spec.javax.annotation</groupId>
extensions/undertow/runtime/pom.xml-                    <artifactId>jboss-annotations-api_1.2_spec</artifactId>
extensions/undertow/runtime/pom.xml-                </exclusion>
--
independent-projects/bootstrap/bom/pom.xml-                <exclusions>
independent-projects/bootstrap/bom/pom.xml-                    <exclusion>
independent-projects/bootstrap/bom/pom.xml:                        <groupId>javax.annotation</groupId>
independent-projects/bootstrap/bom/pom.xml-                        <artifactId>javax.annotation-api</artifactId>
independent-projects/bootstrap/bom/pom.xml-                    </exclusion>
--
independent-projects/bootstrap/bom/pom.xml-                    </exclusion>
independent-projects/bootstrap/bom/pom.xml-                    <exclusion>
independent-projects/bootstrap/bom/pom.xml:                        <groupId>javax.annotation</groupId>
independent-projects/bootstrap/bom/pom.xml-                        <artifactId>javax.annotation-api</artifactId>
independent-projects/bootstrap/bom/pom.xml-                    </exclusion>
--
independent-projects/tools/devtools-common/pom.xml-            <exclusions>
independent-projects/tools/devtools-common/pom.xml-                <exclusion>
independent-projects/tools/devtools-common/pom.xml:                    <groupId>javax.annotation</groupId>
independent-projects/tools/devtools-common/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
independent-projects/tools/devtools-common/pom.xml-                </exclusion>
--
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-            <exclusions>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                <exclusion>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml:                    <groupId>javax.annotation</groupId>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                </exclusion>
--
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-            <exclusions>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                <exclusion>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml:                    <groupId>javax.annotation</groupId>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                </exclusion>
--
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-            <exclusions>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                <exclusion>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml:                    <groupId>javax.annotation</groupId>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
integration-tests/kubernetes/quarkus-standard-way-kafka/pom.xml-                </exclusion>
--
integration-tests/kubernetes/quarkus-standard-way/pom.xml-            <exclusions>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                <exclusion>
integration-tests/kubernetes/quarkus-standard-way/pom.xml:                    <groupId>javax.annotation</groupId>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                </exclusion>
--
integration-tests/kubernetes/quarkus-standard-way/pom.xml-            <exclusions>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                <exclusion>
integration-tests/kubernetes/quarkus-standard-way/pom.xml:                    <groupId>javax.annotation</groupId>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                </exclusion>
--
integration-tests/kubernetes/quarkus-standard-way/pom.xml-            <exclusions>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                <exclusion>
integration-tests/kubernetes/quarkus-standard-way/pom.xml:                    <groupId>javax.annotation</groupId>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
integration-tests/kubernetes/quarkus-standard-way/pom.xml-                </exclusion>
--
test-framework/infinispan-client/pom.xml-                </exclusion>
test-framework/infinispan-client/pom.xml-                <exclusion>
test-framework/infinispan-client/pom.xml:                    <groupId>javax.annotation</groupId>
test-framework/infinispan-client/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
test-framework/infinispan-client/pom.xml-                </exclusion>
--
test-framework/kubernetes-client/pom.xml-            <exclusions>
test-framework/kubernetes-client/pom.xml-                <exclusion>
test-framework/kubernetes-client/pom.xml:                    <groupId>javax.annotation</groupId>
test-framework/kubernetes-client/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
test-framework/kubernetes-client/pom.xml-                </exclusion>
--
test-framework/openshift-client/pom.xml-                </exclusion>
test-framework/openshift-client/pom.xml-                <exclusion>
test-framework/openshift-client/pom.xml:                    <groupId>javax.annotation</groupId>
test-framework/openshift-client/pom.xml-                    <artifactId>javax.annotation-api</artifactId>
test-framework/openshift-client/pom.xml-                </exclusion>

Expected behavior

javax.annotation spreaded centralized in BOM

Actual behavior

javax.annotation excludes spreaded across multiple modules instead of centralized approach in BOM

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Quarkus main

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 2 years ago

/cc @geoand, @iocanel

rsvoboda commented 2 years ago

/cc @aloubyansky @maxandersen

aloubyansky commented 2 years ago

FYI @gsmet. I think the reason to have them in the extension POM files is to satisfy the enforcer plugin building those extension modules.

gsmet commented 2 years ago

We need to be extremely careful about that. I know I had some weird issues when exclusions were partly in the BOM and partly in the dependency declaration. With Maven doing some crazy things and ignoring some of them in some situations, not all.

If we play with that, we will need to check things very cautiously (and I won't be the one doing it).

ppalaga commented 2 years ago

I'd like to point out that we (Camel Quarkus) started excluding all banned artifacts in the BOM a couple of months ago and it works quite well. I have not seen any issues like you mention. Our flattener mojo checks this and fails when an exclusion is missing somewhere. ATM, the mojo is reading the banned deps from our top pom.xml . That's basically a manual copy from quarkus-build-parent. Having a banned list as an artifact (a.k.a. #24880) from Quarkus core would be nice.