You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share the set of banned dependencies and their replacements with Quarkus ecosystem #24880
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.
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?
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?
@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)
Activity
ppalaga commentedon Apr 11, 2022
cc @aloubyansky @mjurc @tqvarnst
gastaldi commentedon Apr 11, 2022
Sounds like something we could include in our Maven/Gradle plugins (or even in the CLI) (something like
quarkus:enforce-dependencies)ppalaga commentedon Apr 14, 2022
Any opinion on this @gsmet @aloubyansky ?
gsmet commentedon 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 commentedon Apr 14, 2022
An idea: Maybe we could add the replacement functionality to the existing enforcer ban rule?
But yes, such a custom yaml bans+replacement definition file would be easier to share within the ecosystem.
gastaldi commentedon Jun 23, 2022
There is the independent-projects/enforcer-rules module which publishes custom enforcer rules.
I think we could move the
bannedDependenciesin the build-parent to a custom rule to facilitate reusegastaldi commentedon Jun 23, 2022
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 commentedon 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 commentedon Jul 6, 2022
@ppalaga we can come up with a custom rule in the
enforcer-rulesproject that would check against a predefined list of banned dependencies (defined in the same project, for example)famod commentedon 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 commentedon 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
8 remaining items
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule
Use ExternalRules enforcer rule