-
Notifications
You must be signed in to change notification settings - Fork 15
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
JavaxServletApi resolution actually downgrades the version #36
Comments
Yes this is true. For such cases, the version of the Capability can be different than the version of the Component. Rules like the JavaxServletApi already encode this knowledge. As the resolution strategy, you would need to use Unfortunately, that's problematic as default, because it is buggy if you need to stack another strategy on top. For example, if there are still two matches with the same version: gradle/gradle#20348 But we can probably reconsider. As you can now turn off single default strategies, you can turn a default strategy off in cases where you run into that bug. @kmoens I am open to discuss using In general, the main motivation to have default resolutions in this plugin is so that folks adding it do not suddenly get a failing build. Maybe this is the wrong motivation. The defaults are never the right choices for everyone. Maybe the preferred way should be to turn them off. After all, the original idea was that this plugin only provides metadata that could also be located in repositories (strategies can not be put into metadata). |
Well, I fully agree with a default strategy. At our company we have about 30-40 projects which are all based on Gradle and we have a company-wide plugin which applies a number of defaults. In that company-wide plugin we also tend to use a strategy to avoid breaking at all. I've opted - in this specific case - to give priority to the Jakarta EE libraries over Tomcat libraries. So if both are present, we pick the Jakarta EE ones. This is not perfect either, but it gives us at least consistent results by default and we don't get downgrades. |
In the This is based on the "Capability Version" rather than the "Module Version". This should resolve this issue. (Test that is does, before closing the issue.) |
The standard resolution of the JavaxServletApi rule is not correct IMHO.
Suppose I have a
build.gradle
as follows:This results in the following classpath:
As Tomcat 6.x is using Servlet API 2.5, we actually downgraded the Servlet API in this case.
This probably applies to other modules in the Java EE / Jakarta EE namespaces too.
The text was updated successfully, but these errors were encountered: