This message was deleted.
# community-support
s
This message was deleted.
v
Iirc you are setting a constraint on the version of the platform, not set the constraints in the platform. You probably want that plaform dependency outside the constraints block.
☝️ 1
a
Thanks, I'll try that.
👌 1
Looks like that does the trick:
Copy code
javaPlatform.allowDependencies()
dependencies {
    constraints {
        api(platform("org.springframework.boot:spring-boot-dependencies:2.7.5"))
    }
    api(platform("org.springframework.boot:spring-boot-dependencies:2.7.5"))
}
The above does make the platform available transitively.
v
That doesn't sound correct though. Are you sure it does not work with
allowDependencies
and without the
constraints
block?
a
I did not test, but wouldn't I also want a constraint on the platform version?
v
Ah, no you are right about the
allowDependendies
, it's even documented 🙂
If you also want a constraint for the platform, sure, but I think then it should be without
platform
So probably something like
Copy code
javaPlatform.allowDependencies()
dependencies {
    constraints {
        api("org.springframework.boot:spring-boot-dependencies:2.7.5")
    }
    api(platform("org.springframework.boot:spring-boot-dependencies:2.7.5"))
}
👍 1
The constraint should afair just care about the version for the coordinates. The
platform(...)
just sets attributes for a dependency so that the platform variant is used. I think for a constraint this should at best be unnecessary clutter.
But try it out. 🙂
a
Will do, thanks for the help.
👌 1