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

Upgrade Gradle #53

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

manuelprinz
Copy link

Dear @VaughnVernon, thank you for your great book! I come back to it regularly, and get something helpful out of it every time!

Lately, I wanted to browse the code to check the implementation of some of the example, and noticed that IDEA is refusing to even index the project because the tooling (specifically Gradle) it too old. So I took some time to get that up-to-date again. I hope you find these contribution valuable, and could apply them to the project, so that it can stay useful and relevant to the DDD community.

This should also close the issues #9, #11, #46 (partially), and #47 (not tested, but likely). It also makes PRs #43 and #31 obsolete.

Noteworthy changes:

  • I update Gradle to 7.6.2, which is the latest stable version in the 7.x series. Gradle 8 should work, but I wanted to be using a version that is supported still.
  • The build configuration was converted from Groovy to the Kotlin DSL, because that provides way better IDE integration, which helps debugging build issues.
  • Each project has its own build configuration now, because centrally configuring all sub-projects has issues. I tried to keep the "spirit" of sharing some configuration by introducing a convention plugin that configures all projects in the same way.
  • Sharing test outputs in the way it was done is not possible anymore. I used the test fixtures mechanism to do that, which is the best practice.
  • I added Gradle toolchain support to manage the JDK used for building and running. Although I tried every trick in the book to get it running with Java 7, I failed. The problem is in the Spring version used, so I upgraded it to the following release, which seems to be fine. (All tests work.) The upside of that change is that users can use any Java version they like to run Gradle, and Gradle will take care of managing the JDK required by the project.
  • I introduced a work-around for running the test by forcing a locale, because some tests fail under non-English locales.
  • Some additional dependencies were needed to get everything to work, as well as some constraints, because of a missing dependency.
  • I added configuration for running the Docker images via Docker Compose, because I could not get the script to run properly. (I think it is the more stable solution for the future.) I also fixed the version of MySQL to 5, because the default image will not work anymore. The advantage is also that users do not need a MySQL client anymore.

There is more that could be done with regards to managing the versions (like Gradle version catalogs) or resolving conflicts. If you are interested in those changes, please let me know. I would be happy to work on that.

Regarding the Docker setup, the use of TestContainers would be nice, to not rely on "external" infrastructures. But I have not even tried that, because most likely all other dependencies would need to be upgraded as well.

If you would like me to split the changes, I can of course do that. I verified that all tests are green, and the project build when running from different Java versions.

Best, Manuel

@lulu2002
Copy link

Hype!

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

Successfully merging this pull request may close these issues.

2 participants