Gradle Issue
Nch002 opened this issue ยท 10 comments
What's the issue you encountered?
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.github.glitchfiend:TerraBlender-forge:1.20.1-2.1.0.137.
How can the issue be reproduced?
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.+', changing: true
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
}
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
version = mod_version
group = mod_group_id
base {
archivesName = mod_id
}
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
mappings channel: mapping_channel, version: mapping_version
copyIdeResources = true
runs {
configureEach {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
client {
property 'forge.enabledGameTestNamespaces', mod_id
}
server {
property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
}
gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id
}
data {
workingDirectory project.file('run-data')
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
minecraft 'net.minecraftforge:forge:' + minecraft_version + '-' + forge_version
implementation fg.deobf('com.github.glitchfiend:TerraBlender-forge:' + minecraft_version + '-' + terrablender_version)
}
tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
forge_version: forge_version, forge_version_range: forge_version_range,
loader_version_range: loader_version_range,
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description,
]
inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}
tasks.named('jar', Jar).configure {
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : mod_authors,
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
finalizedBy 'reobfJar'
}
publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
Logs
No response
Mod Version
1.20.1
Additional information
No response
The file you have provided does not look like the build.gradle file used by the examples here. You must also ensure you have an appropriate settings.gradle/gradle.properties.
ERROR:
Plugin [id: 'org.spongepowered.mixin', version: '0.7-SNAPSHOT'] was not found in any of the following sources:
BUILD GRADLE:
plugins {
id "net.minecraftforge.gradle" version "6.0.+"
id "org.spongepowered.mixin" version "0.7-SNAPSHOT"
id "java"
id "idea"
}
group "test"
archivesBaseName = "Test-forge"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'official', version: minecraft_version
runs {
client = {
workingDirectory = project.file("run").canonicalPath
source sourceSets.main
}
server = {
workingDirectory = project.file("run").canonicalPath
source sourceSets.main
}
}
}
dependencies {
minecraft 'net.minecraftforge:forge:' + minecraft_version + '-' + forge_version
implementation fg.deobf('com.github.glitchfiend:TerraBlender-forge:' + minecraft_version + '-' + terrablender_version)
}
PROPERTY GRADLE
org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
mod_version=1.0.0
minecraft_version=1.20.2
forge_version=48.0.40
terrablender_version=3.1.0.21
The file you have provided does not look like the build.gradle file used by the examples here. You must also ensure you have an appropriate settings.gradle and gradle.properties.
You haven't created a settings.gradle file
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
maven { url = 'https://maven.parchmentmc.org' }
}
}
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
Your settings.gradle file does not match the example https://github.com/Glitchfiend/TerraBlender/blob/TB-1.20.2-3.1.x/Example/Forge/settings.gradle
Your settings.gradle file does not match the example https://github.com/Glitchfiend/TerraBlender/blob/TB-1.20.2-3.1.x/Example/Forge/settings.gradle
I cant use run-data to text it now
nor run-client
I would strongly advise downloading the entirety of the Forge example folder afresh rather than trying to mash it together with whatever you have already. The example gradle setup is known to work and has been tested. This isn't the place for general support with gradle/ForgeGradle issues. For that I would suggest finding some sort of modding support Discord server.