Skip to content

Commit

Permalink
Fix some wonky dependency exclusions in Hibernate ORM/Reactive/Search…
Browse files Browse the repository at this point in the history
… extensions

1. It makes no sense to exclude a transitive dependency if its version
   is managed and we re-declare that dependency ourselves two lines
   below.
2. jakarta.xml.bind-api and jakarta.activation-api are not banned at
   all, are actually transitive dependencies of hibernate-core and
   hibernate-jpamodelgen, and have their version managed in our BOM.
   So there's no need to exclude these transitive dependencies
   or to declare them when we don't use them directly.
3. jakarta.activation-api is a dependency of jakarta.xml.bind-api,
   so there's no point excluding jakarta.activation-api if the same
   module is going to depend on jakarta.xml.bind-api.
4. org.jboss:jandex (old artifact) is no longer a dependency of Hibernate ORM,
   so we don't need to exclude it.
5. io.smallrye:jandex (new artifact) is never required as a runtime dependency
   of Hibernate ORM, so it should be excluded directly in the BOM.
  • Loading branch information
yrodiere committed Dec 1, 2023
1 parent 9e072ed commit e2088f4
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 84 deletions.
15 changes: 2 additions & 13 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5010,8 +5010,9 @@
<artifactId>hibernate-core</artifactId>
<version>${hibernate-orm.version}</version>
<exclusions>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>org.jboss</groupId>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</exclusion>
</exclusions>
Expand Down Expand Up @@ -5074,10 +5075,6 @@
<version>${hibernate-search.version}</version>
<exclusions>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
</exclusion>
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
Expand All @@ -5090,10 +5087,6 @@
<version>${hibernate-search.version}</version>
<exclusions>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
</exclusion>
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
Expand All @@ -5106,10 +5099,6 @@
<version>${hibernate-search.version}</version>
<exclusions>
<!-- We don't want Jandex at runtime -->
<exclusion>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
</exclusion>
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions extensions/hibernate-envers/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-envers</artifactId>
<!-- We need to repeat the same exclusions applied on hibernate-core -->
<exclusions>
<!-- These XML parsers are banned in the project as we use the new package -->
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>

<!-- Following dependencies are only necessary during metadata initialization -->
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
20 changes: 0 additions & 20 deletions extensions/hibernate-orm/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,6 @@
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
<exclusion>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- ByteBuddy is marked as a "runtime" dependency of Hibernate ORM but we need it to compile the extension -->
<dependency>
Expand Down Expand Up @@ -102,12 +88,6 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
Expand Down
6 changes: 0 additions & 6 deletions extensions/hibernate-search-orm-elasticsearch/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-orm</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
Expand Down
12 changes: 0 additions & 12 deletions extensions/panache/hibernate-orm-panache/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

<!-- Explicitly provide banned dependencies, in the correct version -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-activation</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,9 @@
<scope>test</scope>
</dependency>

<!-- Explicitly provide banned dependencies, in the correct version -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- Necessary runtime dependency of jpamodelgen,
which needs to be imported explicitly
otherwise it's not available during annotation processing -->
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-activation</artifactId>
Expand Down
12 changes: 0 additions & 12 deletions extensions/panache/hibernate-reactive-panache/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,6 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

<!-- Explicitly provide banned dependencies, in the correct version -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-activation</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit e2088f4

Please sign in to comment.