e
any ideas?
v
Most important idea: Please never share screenshots of text anywhere unless you want to share anything besides the text like IDE highlighting or similar. Text in images is hard to read - especially on mobile - very hard to copy and nearly impossible to search for. Most important idea about the situation: Do not use
mavenLocal()
like that. It is broken by design in Maven already thus has many problems, and makes your builds slow at best, unreliable and flaky at worst, from failing loudly to silently building wrongly and only misbehaving in production. If you really need to use it, always have it last in the list of repositories and optimally always with a repository content filter that controls exactly what is resolved from there. Regarding the comment questions: At the time the settings script is executed version catalogs are not available yet as settings plugins or also the settings DSL can contribute version catalogs. To generate the
libs.openrndr...
accessors Gradle would need to up-front know the
libs
version catalog before the settings script is even compiled so that it can generate them, so they are not available there. Parsing the version catalog manually you can do, yes. Just use any TOML parser library out there, it is a standard format. There is nothing in the public APi of Gradle that would allow you to parse the version catalog. Alternatively, you could also just use some regex to extract that one version from the file you need.
e
Thanks. Regex it is then. I actually had no idea that mavenLocal() is so problematic and hope I have it as the last entry in places where it matters. About the code in screenshot, I get your points but it is for me by far the most accessible way to ask my question.
v
Well, you decrease the chance of getting answers, your choice. 🙂
e
fair
e
It looks like composite builds are what I should use. IntelliJ's support for composite builds has historically been very broken, which has led us to using mavenLocal. We settled for publishing our library A to mavenLocal such that our library B can consume local snapshot builds of it.
mavenLocal is last in the list but I will add an includeGroup line
v
What problems do you have with IJ and composite builds? I use them on a daily basis since many years and aside from some minor issues that were fixed, it works like a breeze for me.
e
I'd have to dig up the exact problem (our slack is also Langoliering our chat history). I have seen it work and when it worked it was fine. Just at some point IntelliJ failed to handle dependencies from B on A. Symbols were not resolved all of B's code was marked as in error.
We were especially interested in having both A and B loaded into one project.
v
Yeah, always works just fine for me, never seen such problems
e
I follow the "You can also use the Gradle tool window to configure the composite build." instructions here https://www.jetbrains.com/help/idea/work-with-gradle-projects.html#gradle_composite_build and I can't get the "Composite Build Configuration." item to show up in the context menu.
Maybe adding the
includeBuild
manually path has been less problematic in the past. I suspect the gui way is now so broken it has been silently disabled
v
I'd expect the GUI option to basically be like using
--include-build
from the commandline and should work just the same. But yeah, I always made it through the settings script.
it has been silently disabled
You only see it if you followed point 2 and thus have two Gradle projects linked
e
I have two gradle projects linked.
v
Well, no idea, if I link a second, the option appears 🤷‍♂️ But I'm also not on the very latest version but one behind
e
I went back to check and it doesn't work in 2025.1.4 for me either. I am pretty sure I follow the instructions to the point, at this point I find it hard to convince myself it just works. Not that it is your work to do now either btw, it was a wild a tangent after all.
v
Of course it is not my work, I'm just a user of both like you. 😄 If you think you did right and it does not work, it is JetBrains work to help you when you reported it. 🙂