when I run "./gradlew build", I get the error message:
`FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project ‘flashnpcs’.
Could not resolve dependency: net.minecraftforge:forge:1.19.2-42.0.1:userdev
- 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.`
I am using Visual Studio Code
I have tried changing a bunch of code in build.gradle, but nothing seems to be working. I was hoping I would have my project done by now, but there is one error that I can’t seem to fix.
Here is my build.gradle:
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
maven { url = 'https://plugins.gradle.org/m2/' }
maven { url = 'https://jitpack.io' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1+', changing: true
classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.1'
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.spongepowered.mixin'
group = 'flash'
version = '1.2.0'
archivesBaseName = 'flashnpcs'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'official', version: "1.19.2"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run/client')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
arg "-mixin.config=flashnpcs.mixins.json"
mods {
flashnpcs {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run/server')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
arg "-mixin.config=flashnpcs.mixins.json"
mods {
flashnpcs {
source sourceSets.main
}
}
}
}
}
mixin {
config "flashnpcs.mixins.json"
add sourceSets.main, "flashnpcs.refmap.json"
showMessageTypes = true
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
dependencies {
minecraft 'net.minecraftforge:forge:1.19.2-42.0.1'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
// FOR SOME REASON THIS DOESN'T LOAD DURING RUNTIME -,-
// implementation 'org.json:json:20211205'
// shadow 'org.json:json:20211205'
}
/*shadowJar {
archiveBaseName.set('flashnpcs-shadow')
archiveClassifier.set('')
archiveVersion.set(project.version)
minimize()
dependencies {
// include(dependency('org.json:json:20211205'))
}
}*/
jar {
manifest {
attributes([
"Specification-Title" : "flashnpcs",
"Specification-Vendor" : "FlashHUN",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.version,
"Implementation-Vendor" : "FlashHUN",
"MixinConfigs" : "flashnpcs.mixins.json",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
repositories {
}
//jar.dependsOn shadowJar
//jar.enabled = false Why was this here again?
jar.finalizedBy('reobfJar')
Any help appreciated.
2
Answers
That dependency looks odd, usually dependencies are in the form company:software:version, and depending on whether I look at your title or your build script, you have a trailing
-42.0.1
or-42.0.1:userdev
.Try to remove that, i.e., use
See the maven repository.
It looks like you have your versions mixed up. Forge doesn’t have a
1.19.2
version called42.0.1
. There is a 42.0.1 version for1.19.1
.I’m not sure why you’re building against early versions of 1.19. I would recommend using
1.19.4
:However, if you wanted 1.19.2, it would be:
If you specifically needed
42.0.1
, it would need to be 1.19.1:I would recommend picking a version, then downloading the
Mdk
(Mod Development Kit) from Forge and then either modifying or referring back to their build script.