Skip to content

Share the set of banned dependencies and their replacements with Quarkus ecosystem #24880

Closed

Description

@ppalaga

Description

This follows the discussion in quarkusio/quarkus-platform#521

Quarkus does some conscious choices when it comes to preferring some artifacts and banning the alternatives.

Jakarta spec jars are the most prominent example: Generally the jakarta spec artifacts are preferred and the obsolete alternatives coming from JBoss, Glassfish, javax and Geronimo are be banned. There are exceptions to this general rule (Quarkus in some cases prefers jboss or glassfish artifacts) and typically not all existing alternatives are banned (not sure why).

It is similar with logging backends: some third party artifacts are banned in favor of some JBoss logging artifacts.

It is generally beneficial for Quarkus Platform participants to stick with the policies adopted in Quarkus Core. On one hand this increases the chances to get working selection of artifacts in end user applications and on the other hand it may save time and cognitive load with deciding which alternative to choose.

From the platform participant PoV, it is easy to overtake the bans from Quarkus poms, but it is less easy and obvious to implement replacements towards the preferred alternatives.

I wonder whether Quarkus Core maintainers, esp. @gsmet would be ready to maintain this kind of rules in structured form, so that platform participant projects and Quarkus Platform itself can observe/enforce them automatically.

Implementation ideas

I do not have any specific format or tool in mind. Enforcer plugin forks well for enforcing bans, but I am not aware that it would also allow enforcing replacements. I'd be thankful for any suggestions.

Activity

  1. added
    kind/enhancement
    on Apr 11, 2022
  2. ppalaga commented on Apr 11, 2022

    @ppalaga
    ContributorAuthor
  3. gastaldi commented on Apr 11, 2022

    @gastaldi
    Member

    Sounds like something we could include in our Maven/Gradle plugins (or even in the CLI) (something like quarkus:enforce-dependencies)

  4. added
    area/devtools
    and removed on Apr 11, 2022
  5. ppalaga commented on Apr 14, 2022

    @ppalaga
    ContributorAuthor

    Any opinion on this @gsmet @aloubyansky ?

  6. gsmet commented on Apr 14, 2022

    @gsmet
    Member

    Sorry, I'm quite busy these days with the Jakarta migration.
    The enforcer doesn't allow us to provide replacements (even as a hint) and that's a bit of a bummer but if we want something done quickly, maybe we should keep using it?
    I haven't found at a quick glance if we could use rules stored in a published XML file. If not, maybe we will end up having a custom rule that can get the info from a YAML file that contains both the banned dependency and the replacement and we could push the replacement as a hint in the error message?

    @famod maybe you have some ideas about that?

  7. ppalaga commented on Apr 14, 2022

    @ppalaga
    ContributorAuthor

    An idea: Maybe we could add the replacement functionality to the existing enforcer ban rule?

    having a custom rule that can get the info from a YAML file that contains both the banned dependency and the replacement

    But yes, such a custom yaml bans+replacement definition file would be easier to share within the ecosystem.

  8. gastaldi commented on Jun 23, 2022

    @gastaldi
    Member

    There is the independent-projects/enforcer-rules module which publishes custom enforcer rules.

    I think we could move the bannedDependencies in the build-parent to a custom rule to facilitate reuse

  9. gastaldi commented on Jun 23, 2022

    @gastaldi
    Member

    FWIW I created https://issues.apache.org/jira/browse/MENFORCER-422 asking for reading a list of banned dependencies from an external file/URL

  10. ppalaga commented on Jul 6, 2022

    @ppalaga
    ContributorAuthor

    Thanks @gastaldi, an artifact containing the bans solves a substantial part of the problem.
    Any idea how we could maintain and ideally also enforce the preferred replacements?

  11. gastaldi commented on Jul 6, 2022

    @gastaldi
    Member

    @ppalaga we can come up with a custom rule in the enforcer-rules project that would check against a predefined list of banned dependencies (defined in the same project, for example)

  12. famod commented on Jul 6, 2022

    @famod
    Member

    Yeah, this could/should work.

    Are we talking about rules enforced by the main repo or are we talking about multiple sets of rules?

  13. gastaldi commented on Jul 6, 2022

    @gastaldi
    Member

    @famod my understanding is that this request is for reusing this rule: https://github.com/quarkusio/quarkus/blob/main/build-parent/pom.xml#L494-L599

  14. 8 remaining items

  15. added 11 commits that reference this issue on Aug 16, 2022
    839e53b
    e750bf8
    c9ebaa3
    f1d0fdd
    f2903f9
    27a6be3
    62035eb
    3a41508
    84e77da
    1220162
    ce2b969
  16. added this to the 2.13 - main milestone on Aug 30, 2022
  17. added a commit that references this issue on Aug 31, 2022
    a3dea45
  18. added a commit that references this issue on Sep 8, 2022
    07bbd9f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/devtoolskind/enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions