Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup forge error #2

Open
Midaco-YT opened this issue Feb 18, 2024 · 1 comment
Open

setup forge error #2

Midaco-YT opened this issue Feb 18, 2024 · 1 comment

Comments

@Midaco-YT
Copy link

trying to setup forge I got this error :

F:\Valerium\forge>gradlew setupForge
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/3.0/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing

FAILURE: Build failed with an exception.

* Where:
Build file 'F:\Valerium\forge\build.gradle' line: 42

* What went wrong:
Could not compile build file 'F:\Valerium\forge\build.gradle'.
> startup failed:
  build file 'F:\Valerium\forge\build.gradle': 42: unable to resolve class net.minecraftforge.gradle.dev.ForgeDevPlugin
 @ line 42, column 1.
     import static net.minecraftforge.gradle.dev.ForgeDevPlugin.*
     ^

  build file 'F:\Valerium\forge\build.gradle': 42: unable to resolve class net.minecraftforge.gradle.dev.ForgeDevPlugin
 @ line 42, column 1.
     import static net.minecraftforge.gradle.dev.ForgeDevPlugin.*
     ^

  2 errors


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.37 secs

F:\Valerium\forge>

build.gradle:

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "https://maven.minecraftforge.net"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
        maven {
            name = "maven-mirror"
            url = "https://repo.maven.apache.org/maven2"
        }
    }
    dependencies {
        classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {

    changing = true
        }
    }
}

// fixes building errors due to switch to HTTPS
allprojects {
    repositories {
        all { ArtifactRepository repo ->
            if (repo instanceof MavenArtifactRepository){
                if (repo.url.toString().startsWith("http://repo1.maven.org/maven2")) {
                    repo.url = repo.url.toString().replace("http://", "https://")
                }
            }
        }
    }
}

configurations {
    deployJars
}

import static net.minecraftforge.gradle.dev.ForgeDevPlugin.*

apply plugin: 'maven'
apply plugin: 'forgedev'

repositories {
    mavenLocal()
    flatDir {
        name "fileRepo"
        dirs "repo"
    }
}

minecraft {
    version = '1.7.10'
    mcpVersion = '9.05'
    fmlDir = projectDir.getAbsolutePath() + "/fml";
    mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
    tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
    installerVersion = "1.4"
}

group = 'net.minecraftforge'
version = getVersionFromJava(getProject(), 'src/main/java/net/minecraftforge/common/ForgeVersion.java')

jenkins {
    job = 'minecraftforge'
}


launch4j {
    jreMinVersion = '1.6.0'
}

// fixes building jar, although errors are present when building
createChangelog.enabled = false
@Doenerstyle
Copy link
Owner

Hello there and thanks for the report!
I assume that the error occurs due to changes made on anatawa12's fork of ForgeGradle.
I've been wanting to properly release and include my own fork of ForgeGradle (only meant for this fork of Forge) for quite some time and now finally managed to do so. If you use the now updated build.gradle from this repository, your Forge should successfully build (despite Gradle telling you BUILD FAILED).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants