Plugin [id: 'net.minecraftforge.gradle.forge', artifact: 'com.github.asbyth:ForgeGradle:ddb1eb0'] was not found in any of the following sources

I am trying to develop a minecraft 1.8.9 Forge mod, but I keep getting this error:
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\User\Desktop\Project\build.gradle' line: 3

* What went wrong:
Plugin [id: 'net.minecraftforge.gradle.forge', artifact: 'com.github.asbyth:ForgeGradle:ddb1eb0'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.github.asbyth:ForgeGradle:ddb1eb0')
  Searched in the following repositories:
    MavenRepo
    maven(https://maven.minecraftforge.net/)
    maven2(https://jitpack.io/)

* 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

BUILD FAILED in 5s

I am unsure what to do now so I went here

btw my build.gradle file:

plugins {
    id "java"
    id "net.minecraftforge.gradle.forge"
}

group 'me.github.shurpe'
version '1.0'

sourceCompatibility = targetCompatibility = 1.8
compileJava.options.encoding = "UTF-8"

minecraft {
    version = "1.8.9-11.15.1.2318-1.8.9"
    runDir = "run"
    mappings = "stable_22"
    makeObfSourceJar = false
}

jar {
    exclude "**/mcmod.info"
}

How does your settings script look like?

pluginManagement {
repositories {
mavenCentral()

    maven { url = "https://maven.minecraftforge.net/" }
    maven { url = "https://jitpack.io/" }
}
resolutionStrategy {
    eachPlugin {
        if (requested.id.id == "net.minecraftforge.gradle.forge")
            useModule("com.github.asbyth:ForgeGradle:ddb1eb0")
    }
}

}

rootProject.name = ‘somethingHereModNameIdk’

As you see in your settings script, you manually map the plugin id to a fork of ForgeGradle, that existed in the past: GitHub - asbyth/ForgeGradle: Minecraft mod development framework used by Forge and FML for the gradle build system
Now it does not exist anymore or is set to private: https://github.com/asbyth/ForgeGradle, so your cannot use it anymore, as you didn’t use a proper release, but a JitPack build.

Use the main project by removing that manual mapping and adding a version for the plugin.

what version should I use and how? I think that ForgeGradle plugin no longer works because 1.8.9 is no longer supported, so what version or what fork should I use and how? Thanks

I have a example mod tested in 2022 and it still doesnt work for me, here is the build.gradle
buildscript {
repositories {
//new forge repository
maven { url “https://maven.minecraftforge.net” }
}
dependencies {
classpath “net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT”
}
}

plugins {
id “java”
id “com.github.johnrengelman.shadow” version “2.0.4”
}

apply plugin: “net.minecraftforge.gradle.forge” //Here it fails: Failed to apply plugin ‘net.minecraftforge.gradle.forge’. Configuration with name ‘compile’ not found.

version = “1.0”
group = “dreamys.studio” //Maven – Guide to Naming Conventions
archivesBaseName = “examplemod” //name of the output jar

sourceCompatibility = targetCompatibility = 1.8 //using java 8
compileJava.options.encoding = “UTF-8”

minecraft {
version = “1.8.9-11.15.1.2318-1.8.9”
runDir = “run”
mappings = “stable_22” //mappings for 1.8.9
makeObfSourceJar = false //disable creation of sources jar
}

configurations {
shade
compile.extendsFrom(shade)
}

repositories {
//repos for libraries (not gradle plugins)
//example:
//maven { url “https://repo.dreamys.studio/” }
}

dependencies {
//shade will bundle your library to the output jar
//your libraries will be accessible outside of intellij
//example:
//shade “studio.dreamys:libSkyblock:1.1.1”

//compile will make your library available only in this dev environment
//your libraries wont be accessible outside of intellij
//example:
//compile "studio.dreamys:libSkyblock:1.1.1"

}

processResources {
//this will ensure that this task is redone when the versions change.
inputs.property “version”, project.version
inputs.property “mcversion”, project.minecraft.version

//replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
    include "mcmod.info"

    //replace version and mcversion
    expand "version":project.version, "mcversion":project.minecraft.version
}

//copy everything else, that"s not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
    exclude "mcmod.info"
}

rename '(.+_at.cfg)', 'META-INF/$1'

}

shadowJar {
dependencies {
//we remove gson because it belongs to the public api and will break shading
//exclude(dependency(“com.google.code.gson:gson:2.8.6”))
}
configurations = [project.configurations.shade]
duplicatesStrategy DuplicatesStrategy.EXCLUDE //prevent duplicates
classifier “” //prevent creation of unshadowed jar
}

reobf {
//reobfuscate the shadowed jar
shadowJar {}
}

what version should I use and how?

I have no idea, I don’t do MC development and this is not a MC mod forum.

I think that ForgeGradle plugin no longer works because 1.8.9 is no longer supported, so what version or what fork should I use and how?

Why 1.8.9?
Latest released version is 2.0.2 as you can see at GitHub - MinecraftForge/ForgeGradle: Minecraft mod development framework used by Forge and FML for the gradle build system.
As even that is from 2015, whether it still works or you need some fork I don’t know, ask in some MC mod forum please, resp. in the Gitter chat of the plugin as linked to in their README.
To use the 2.0.2 you do not need any special repository or manual dependency or the legacy apply syntax.
You can just use the plugins block as usual: Gradle - Plugin: net.minecraftforge.gradle.forge

If you get the error

Configuration with name ‘compile’ not found.

that means that the plugin is not compatible with the Gradle version you are using.
The compile configuration was deprecated for many many years and with Gradle 7.0 finally removed.
So if you get that error, it seems the plugin version is at least incompatible with Gradle 7 and newer.