CodexBloom - Programming Q&A Platform

Eclipse 2023-09: implementing Custom Gradle Plugin Not Resolving Dependencies in Multi-Module Project

👀 Views: 62 💬 Answers: 1 📅 Created: 2025-06-14
Eclipse Gradle Plugin Groovy

I'm stuck trying to I'm writing unit tests and I've been struggling with this for a few days now and could really use some help. I've searched everywhere and can't find a clear answer... I'm working on a project and hit a roadblock. I'm currently working on a multi-module Gradle project in Eclipse 2023-09, and I've run into a frustrating scenario where my custom Gradle plugin is not resolving dependencies correctly. The plugin is supposed to handle versioning for our service modules, but when I run the build, I get the following behavior: ``` Could not resolve all files for configuration ':moduleA:compileClasspath'. > Could not find com.example:my-library:1.0.0. ``` I've checked the build.gradle files for each module, and the dependencies seem to be correctly declared. Here's a snippet from my `moduleA/build.gradle`: ```groovy plugins { id 'java' id 'com.example.my-custom-plugin' } dependencies { implementation 'com.example:my-library:1.0.0' } ``` In the root `build.gradle`, I have the following configuration for the repositories: ```groovy allprojects { repositories { mavenCentral() maven { url "https://my.custom.repo" } } } ``` The custom plugin is defined in the root project as well, like this: ```groovy class MyCustomPlugin implements Plugin<Project> { void apply(Project project) { project.dependencies { implementation 'com.example:my-library:1.0.0' } } } ``` I have verified that `my-library` is indeed available in the specified repository and that the version `1.0.0` exists. To troubleshoot, I cleared the Gradle cache using `gradle clean build --refresh-dependencies`, but that didn’t help. Additionally, I have set the `Gradle Build` toolchain in Eclipse preferences to the correct version (Gradle 7.5). Still, the question continues. Has anyone encountered similar issues with Eclipse and custom Gradle plugins? Any insights on what might be going wrong or further steps I could take to debug this? This is part of a larger API I'm building. Thanks in advance! This is part of a larger CLI tool I'm building. Has anyone else encountered this? My team is using Groovy for this CLI tool. Thanks for your help in advance! Is this even possible?