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

Introduce a BOM (Bill of Materials) for SmallRye GraphQL #2270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

velo
Copy link
Contributor

@velo velo commented Feb 21, 2025

Motivation

Currently, users who depend on multiple SmallRye GraphQL artifacts must explicitly specify the version for each dependency, as shown in the example below:

<dependency>
  <groupId>io.smallrye</groupId>
  <artifactId>smallrye-graphql-api</artifactId>
  <version>${smallrye-graphql.version}</version>
</dependency>
<dependency>
  <groupId>io.smallrye</groupId>
  <artifactId>smallrye-graphql-cdi</artifactId>
  <version>${smallrye-graphql.version}</version>
</dependency>
...

This approach introduces unnecessary complexity, especially when integrating SmallRye GraphQL via frameworks like Quarkus. If a user needs to override the SmallRye GraphQL version, they must do so for each individual artifact.
Solution

I have a list of 11 dependencies to make sure a override it all from quarkus graphql client.

This PR introduces a Bill of Materials (BOM) for SmallRye GraphQL, allowing users to manage all SmallRye GraphQL dependencies with a single import:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.smallrye</groupId>
      <artifactId>smallrye-graphql-bom</artifactId>
      <version>${smallrye-graphql.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

With this change, users can:

  • add SmallRye GraphQL dependencies without explicitly specifying versions:
<dependency>
  <groupId>io.smallrye</groupId>
  <artifactId>smallrye-graphql-client</artifactId>
</dependency>
  • override smallrye-graphql version with a single entry on dependencyManagement

This simplifies version management and improves maintainability, making it easier to update SmallRye GraphQL across projects.

Impact

Reduces the number of explicit version declarations needed in projects using SmallRye GraphQL.
Simplifies dependency management for Quarkus users relying on quarkus-smallrye-graphql-client.
Improves maintainability by centralizing version management in a BOM.

Let me know if you need any adjustments! 🚀

@jmartisk
Copy link
Member

Thanks, I think this is an awesome idea that we should have implemented earlier. I'm just worried a bit about the impact on the release automation, but hopefully it won't be much of a trouble (we won't know until we actually perform a release though)

<plugin>
<groupId>io.sundr</groupId>
<artifactId>sundr-maven-plugin</artifactId>
<version>0.200.0</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract this to a property, like all other dependency versions


<modules>
<includes>
<include>io.smallrye:*</include>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should exclude test-related modules (smallrye-graphql-integration-tests, smallrye-graphql-client-generator-test, smallrye-graphql-maven-plugin-tests, smallrye-graphql-tck, smallrye-graphql-client-tck) and also smallrye-graphql-documentation, so maybe it would be better to explicitly list the modules to include (without a wildcard)

@jmartisk
Copy link
Member

Looking at this, I've also noticed that after moving to the new release process, our test-related modules have started being published too (see for example https://repo1.maven.org/maven2/io/smallrye/smallrye-graphql-integration-tests/2.12.1/) - CC @radcortez and @gastaldi - how do I avoid that? The modules set skipNexusStagingDeployMojo=true which doesn't seem to work anymore

@gastaldi
Copy link

@jmartisk you just put the modules in a profile and disable them during the release.
See https://github.com/quarkiverse/quarkus-ironjacamar/blob/main/pom.xml#L79-L90

@jmartisk
Copy link
Member

Thanks @gastaldi, I've created #2272 for that

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

Successfully merging this pull request may close these issues.

3 participants