Not sure what might be causing the problem... I ha...
# gradle
d
Not sure what might be causing the problem... I have a dependency on two modules in my build.gradle.kts, and only the first one of the two seems to get loaded... if I change the order it's always the first one, the second one is ignored.
Copy code
implementation(project(":legacy:domain"))
    implementation(project(":domain"))
v
If the group and name of the project is the same, it is the same project for Gradle, so it does conflict resolution and uses the newest version and if this is the same probably just the first.
d
Oh... So domain by itself and legacy domain are the same... I have to put :domain into it's own group and then it'll work?
Like legacydomain and
:new:domain
v
That wouldn't change anything, you just change the parent project from
<root>
to
:new
. But they would still have the same group and name and thus would still be considered the same by resolution engine. As I said, you have to either change the group or the name of one of those. You can also use the tasks
:domain:outgoingVariants
and
:legacy:domain:outgoingVariants
to see it.
d
I'm confused then... where is this group I need to set?
It's all supposed to compile into one jar, and the modules aren't separate libraries...
v
It is a property on
project
, so a mere
group = "..."
in the build script configures it. Besides that I'm not a fan of fat jars, how you package it does not matter. They are separate projects, so they need to be uniquely identifiable using their group and name. So either rename one of them, for example to
:legacy:legacy-domain
, or set a different group, so that the ID (group / name) of the two project is distinct.
👍 1
d
Thanks, that worked 😃!