"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')
publishing {
publications {
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
}[/spoiler]
复制代码
报错:
org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':mavenDownloader_net.minecraftforge_accesstransformers_8.0.+_fatjar_1'
gradle.internal.resolve.ModuleVersionNotFoundException: Cannot resolve external dependency net.minecraftforge:accesstransformers:8.0.+ because no repositories are defined.
Error getting artifact: net.minecraftforge:forge:1.18.2-40.2.0_mapped_parchment_2022.11.06-1.18.2:null@jar from MinecraftUserRepo
Could not resolve all files for configuration ':runtimeClasspathCopy'.
> Could not find net.minecraftforge:forge:1.18.2-40.2.0_mapped_parchment_2022.11.06-1.18.2.