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

Better way to simply force a dependency #101

Open
rupebac opened this issue Jun 17, 2019 · 1 comment
Open

Better way to simply force a dependency #101

rupebac opened this issue Jun 17, 2019 · 1 comment

Comments

@rupebac
Copy link

rupebac commented Jun 17, 2019

I am surprised that there is no rule type to simply force a specific version of a transitive dependency. I know I can achieve this with:

substitute": [
    {
      "module" : "org.myorg.group:myartifact",
      "with" : "org.myorg.group:myartifact:2.1.2",
      "reason" : "blabla",
      "author" : "me",
      "date" : "2019-06-14"
    },
]

but, it looks a bit not straight forward, why do I have to specify the GAV coordinate twice when I simply want to force 2.1.2 there?

Also, I would like to propose another feature. In align rules you have the attribute "includes" which allow formats like:

"includes": ["springfox-(bean-validators|core|schema|spi|spring-web|swagger-common|swagger-ui|swagger2|)"],

why don't you support the same syntax in more attributes, like the previous "substitute", so you can have something like:

substitute": [
    {
      "module" : "org.myorg.group:(myartifact|myartifact2|myartifact3)",
      "with" : "org.myorg.group:(myartifact|myartifact2|myartifact3):2.1.2",
      "reason" : "blabla",
      "author" : "me",
      "date" : "2019-06-14"
    },
]
@chali
Copy link
Member

chali commented Jun 19, 2019

Hi @rupebac thank you for the feedback. The reason why alignment rules support includes is that they are conceptually slightly different. One alignment rule is expected to operate on a group of dependencies. The proposal for substitution is just a convenience for easier declaration of multiple rules affecting independent dependencies. You can add all substitution rules into a single file like:

substitute": [
    {
      "module" : "org.myorg.group:myartifact",
      ...
    },
    {
      "module" : "org.myorg.group:myartifact2",
      ...
    }
]

We don't have a big burden with such notation. That said we are not going to implement any time soon. If you are willing to contribute we are open to PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants