“platform-bom” is a java-platform type which constraints the dependencies
“build-logic” is build logical type which defined a plugin named ‘com.example.my-plugin’. In plugin we define a dependency on platform-bom with maven GAV.
“app” is a application type project which use the com.example.my-plugin plugin
Run command
./gradlew run
Error log
Error log
* What went wrong:
Could not determine the dependencies of task ':app:run'.
> Could not resolve all task dependencies for configuration ':app:runtimeClasspath'.
> Cannot resolve external dependency com.example:platform-bom:1.0 because no repositories are defined.
Required by:
project :app
> Cannot resolve external dependency jakarta.inject:jakarta.inject-api because no repositories are defined.
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Yes, I have changed ‘implemetation’ to ‘implementation’.
And I changed the POST content. You can find the ERROR LOG part.
But it will get the other problem that I just want to ask.
> Could not determine the dependencies of task ':app:run'.
> > Could not resolve all task dependencies for configuration ':app:runtimeClasspath'.
> > Cannot resolve external dependency com.example:platform-bom:1.0 because no repositories are defined.
> Required by:
> project :app
> > Cannot resolve external dependency jakarta.inject:jakarta.inject-api because no repositories are defined.
> Required by:
> project :app
I will update my attachment.
The ‘com.example:platform-bom’ dependency constraints 'jakarta.inject:jakarta.inject-api:2.0.1' jar file.
But I have to defined the depenpendcy in plugin in build-logic project. This plugin is used in application project app.
While you should include build-logic with pluginManagement { ... } as it contributes plugins (and must be done there if you also add some settings plugin), your platform-bom project is nowhere included. And the error about inject-api is as it states. You define a dependency on it, but have no repositories defined. This wouldn’t have changed even if the BOM would be found.