-
Notifications
You must be signed in to change notification settings - Fork 85
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
Use dependency versions from the grails-bom
where available
#57
Conversation
When creating the `JavaMailSender` via constructor, it could not connect to the greenmail server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor suggestions.
`groovy-templates` and `grails-docs` are also in `grails-bom`
To restrict the use of groups.
- Remove explicit versions to where versions are available in `grails-bom` - Use `org.eclipse.angus:jakarta.mail` instead of `com.sun.mail:jakarta.mail` - Restrict the use of version catalog alias groups
`2.0.1` -> `2.1.0`
Well, I will ask the obvious.... now that we use the bom for versions, what is the point of using toml? doesn't it just make things more confusing and result in 2x lines of code? Does it provide anything of value? |
Using a version catalog has several advantages.
|
If it is anything, it is definitely NOT DRY. uh, it looks like you are declaring them twice Lines 24 to 54 in c0a82ec
grails-mail/gradle/libs.versions.toml Lines 15 to 36 in c0a82ec
now that we use a bom, you could completely delete It's way too verbose. I am surprised there aren't semi-colons required on every line as well. 🤣 What makes more sense and is easier to understand? These 132 characters:
or these 36 compileOnly 'org.grails:grails-core' Objectively I see 75% less characters and a 1 less file to maintain. |
First of all, you are quoting an old version before the new Second, this is indeed DRY because the coords and versions are never repeated but can be and are used in multiple places. |
DRY?
compileOnly 'org.grails:grails-core' You shouldn't have open another file to look up coordinates, but this is just my opinion. Hopefully it will evolve into something better someday... Anyhow, I prefer SCOTTL format 😄 |
Why do you need to see the coordinates? If you do, ctrl-click in Intellij to go right to the declaration.
compileOnly 'jakarta.servlet:jakarta.servlet-api' // Provided by the servlet container |
compared to? how is that handled any better with toml? I suppose if that happened a lot, I would just create another dependency scope 😉 |
It appears we have different interpretations of DRY. My emphasis is on data and logic, whereas I perceive from this discussion that your focus is on the number of characters. Another advantage of using a version catalog that I mentioned is the centralized location. |
Can you explain your example? how does toml handle that any better? My version of DRY is not characters. It is avoiding repeating yourself, which in my opinion, toml is not avoiding when used with a bom. I also prefer clear and concise which it is lacking in both. It just further complicates the build and adds an extra learning curve to an already over complicated build process. Do you honestly think it does not add an unnecessary additional learning curve to the majority of gradle users? |
The example is the alternative version, when not using a version catalog. As
From https://en.wikipedia.org/wiki/Don%27t_repeat_yourself:
As I said earlier, I think version catalogs have several advantages. Gradle changes, hopefully to the better, for every version it releases. We should embrace those improvements, and I think version catalogs are not a very hard concept to grasp. If you are a totally new Gradle user, maybe it is even easier? Also with modern IDEs, you get auto-completion, click-through, unused code highlighting etc. My subjective view is also that it is easier to read good named aliases, rather than parsing maven coordinate/version "gibberish" when I scan build files. |
vs 2 files for:
I honestly don't see the win here. Using toml you are still repeating yourself, and making it more difficult to follow. Not everyone uses IntelliJ and IntelliJ click through doesn't always work. The Grails IntelliJ plugin was broken for a year on Grails 6 and you couldn't click through on anything you used to be able to click on. In the end, the coordinates are the coordinates. Assigning a variable to them in a proprietary experimental format that has still yet to stabilize and provide a full feature set just seems like an over complication. It's basically the route Grails 6 took over 5. It overcomplicated everything adding an unnecessary buildSrc folder and a bunch of configuration in settings.gradle. It just made things more difficult to follow and confused a lot of people. There are a lot of people thoroughly confused by this type of versioning as well. At the end of the day you have TEN build files (.gradle +.toml) for a very simple plugin which unfortunately will cause a lot of people to get lost who would like to contribute. Why are we making things so complicated? Convention over configuration and DRY are paradigms to make things simpler, not more complicated. In my opinion, this plugin should consist of 1 build.gradle and that is it. We will have to agree to disagree here. I am fine with the merge. I think you did a good job cleaning it up further. I just like to keep things as simple as possible and look for ways to remove configuration, not add it. For now, this is simpler than the previous version so let's just merge this and move on. |
Agreed 😉 While the benefits in this project may seem marginal, I believe they become more apparent when these concepts are applied to more complex projects. |
And some other improvements and cleanup.