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

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

Closed
ppalaga opened this issue Apr 11, 2022 · 16 comments · Fixed by #27294
Closed

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

ppalaga opened this issue Apr 11, 2022 · 16 comments · Fixed by #27294
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins kind/enhancement New feature or request
Milestone

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Apr 11, 2022

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.

@ppalaga ppalaga added the kind/enhancement New feature or request label Apr 11, 2022
@ppalaga
Copy link
Contributor Author

ppalaga commented Apr 11, 2022

cc @aloubyansky @mjurc @tqvarnst

@gastaldi
Copy link
Contributor

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

@gastaldi gastaldi added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins and removed triage/needs-triage labels Apr 11, 2022
@ppalaga
Copy link
Contributor Author

ppalaga commented Apr 14, 2022

Any opinion on this @gsmet @aloubyansky ?

@gsmet
Copy link
Member

gsmet commented Apr 14, 2022

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?

@ppalaga
Copy link
Contributor Author

ppalaga commented Apr 14, 2022

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.

@gastaldi
Copy link
Contributor

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

@gastaldi
Copy link
Contributor

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

@ppalaga
Copy link
Contributor Author

ppalaga commented Jul 6, 2022

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?

@gastaldi
Copy link
Contributor

gastaldi commented Jul 6, 2022

@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)

@famod
Copy link
Member

famod commented Jul 6, 2022

Yeah, this could/should work.

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

@gastaldi
Copy link
Contributor

gastaldi commented Jul 6, 2022

@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

@ppalaga
Copy link
Contributor Author

ppalaga commented Jul 6, 2022

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

We (Camel Quarkus) are primarily interested in getting a way to consume the bans defined by Quarkus.

Secondarily, it would be nice be able to define more bans and replacements in a similar way on our side, so that projects (such as Camel K) based on Camel Quarkus can consume them.

@ppalaga
Copy link
Contributor Author

ppalaga commented Aug 10, 2022

Any progress here? I am reviewing the dependency management in quarkus-cxf and having a list of banned artifacts and their replacements would be extremely useful.

@gastaldi
Copy link
Contributor

No progress so far, but I can have a look if it's urgent

@gastaldi
Copy link
Contributor

@ppalaga I created https://github.com/gastaldi/descriptor-rule as the initial prototype. It is a custom enforcer rule that executes other enforcer rules declared in a shared descriptor (much like what was proposed in https://issues.apache.org/jira/browse/MENFORCER-422)

Take a look and let me know how that works for you. My plan is to release an alpha version so we can use it right away and then submit a PR to the maven-enforcer-plugin repository to incorporate as a built-in rule

@gastaldi
Copy link
Contributor

I have also created a PR upstream: apache/maven-enforcer#180

gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 15, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated in the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit that referenced this issue Aug 15, 2022
- Fixes #24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 15, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 16, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 16, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 17, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 18, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 23, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 23, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 23, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 23, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 23, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 25, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
gastaldi added a commit to gastaldi/quarkus that referenced this issue Aug 26, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
@quarkus-bot quarkus-bot bot added this to the 2.13 - main milestone Aug 30, 2022
fercomunello pushed a commit to fercomunello/quarkus that referenced this issue Aug 31, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
evanchooly pushed a commit to nenros/quarkus that referenced this issue Sep 8, 2022
- Fixes quarkusio#24880

This moves the rules to an external rule file to allow reusing enforcer rules in another modules.
For more information: https://github.com/gastaldi/enforcer-rules#externalrules

PS: The ExternalRules rule is tracked in [MENFORCER-422](https://issues.apache.org/jira/browse/MENFORCER-422)  will be migrated to the maven-enforcer-plugin upstream
repository in this PR:

- apache/maven-enforcer#180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants