Ошибка в Eclipse

Версия Minecraft
1.12.2
Доброе время суток.
Делал всё по гайдам на сайте. Дошёл до момента открытия Eclipsa. Открыл Eclips, с файлом Eclipse. При попытке импортировании "Gradle > Gradle Project", выдаёт ошибку (Красный ! знак), и не даёт нажать на "Finish".
Screenshot_196.png
 

timaxa007

Модератор
5,831
409
672
Учитывая "Problems", у тебя что-то не гладко пошло при gradlew.
Делал всё по гайдам на сайте.
Где?
Но те уроки которые я видел ... Можно сказать не актуально, последняя версия 1.12.2 сделана наподобие новых версиях Forge. gradlew genEclipseRuns или gradlew genIntellijRuns, для соответствующей версии IDE.
Для workspace нужно создавать отдельную папку, которая не должна находиться где находиться Gradle проект.
И импортируешь Gradle Forge'а.
У меня пути:
C:\forge\1.12.2\ - для gradle от Forge'а.
C:\forge\1.12.2_eclipse\ - для workspace eclipse'а.
И ещё нужно будет настроить запуск программы в IDE.
1589389922533.png
1589389754464.png
 

WantaSanchez

Опоздун
633
17
150

WantaSanchez

Опоздун
633
17
150
олько Gradle "genEclipseRuns",
Вообще, если Forge 1.12.2 сборки 2020-го года, то там setupDecompWorkspace заменили на build, который Eclips выполняет сам при импорте папки проекта, а потом выполнить eclipse в папке ide.
 
Такс.... запустил gradle genEclipseRuns, и теперь возника ошибка.

Gradle (Groovy):
C:\Mod>gradlew genEclipseRuns
Downloading https://services.gradle.org/distributions/gradle-4.9-all.zip
............................................................................................................

Welcome to Gradle 4.9!

Here are the highlights of this release:
 - Experimental APIs for creating and configuring tasks lazily
 - Pass arguments to JavaExec via CLI
 - Auxiliary publication dependency support for multi-project builds
 - Improved dependency insight report

For more details see https://docs.gradle.org/4.9/release-notes.html

Download https://plugins.gradle.org/m2/net/minecrell/licenser/net.minecrell.licenser.gradle.plugin/0.4.1/net.minecrell.licenser.gradle.plugin-0.4.1.pom
Download https://plugins.gradle.org/m2/org/ajoberstar/grgit/org.ajoberstar.grgit.gradle.plugin/3.0.0/org.ajoberstar.grgit.gradle.plugin-3.0.0.pom
Download https://plugins.gradle.org/m2/com/github/ben-manes/versions/com.github.ben-manes.versions.gradle.plugin/0.20.0/com.github.ben-manes.versions.gradle.plugin-0.20.0.pom
Download https://plugins.gradle.org/m2/gradle/plugin/net/minecrell/licenser/0.4.1/licenser-0.4.1.pom
Download https://plugins.gradle.org/m2/org/ajoberstar/grgit/grgit-gradle/3.0.0/grgit-gradle-3.0.0.pom
Download https://plugins.gradle.org/m2/com/github/ben-manes/gradle-versions-plugin/0.20.0/gradle-versions-plugin-0.20.0.pom
Download https://plugins.gradle.org/m2/org/ajoberstar/grgit/grgit-core/3.0.0/grgit-core-3.0.0.pom
Download https://plugins.gradle.org/m2/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.pom
Download https://plugins.gradle.org/m2/org/codehaus/gpars/gpars/1.2.1/gpars-1.2.1.pom
Download https://plugins.gradle.org/m2/com/thoughtworks/xstream/xstream-parent/1.4.10/xstream-parent-1.4.10.pom
Download https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/5.1.3.201810200350-r/org.eclipse.jgit-5.1.3.201810200350-r.pom
Download https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit-parent/5.1.3.201810200350-r/org.eclipse.jgit-parent-5.1.3.201810200350-r.pom
Download https://plugins.gradle.org/m2/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.pom
Download https://plugins.gradle.org/m2/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.pom
Download https://plugins.gradle.org/m2/org/multiverse/multiverse-core/0.7.0/multiverse-core-0.7.0.pom
Download https://plugins.gradle.org/m2/org/codehaus/jsr166-mirror/jsr166y/1.7.0/jsr166y-1.7.0.pom
Download https://plugins.gradle.org/m2/org/multiverse/multiverse/0.7.0/multiverse-0.7.0.pom
Download https://plugins.gradle.org/m2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.pom
Download https://plugins.gradle.org/m2/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.pom
Download https://plugins.gradle.org/m2/com/jcraft/jsch/0.1.54/jsch-0.1.54.pom
Download https://plugins.gradle.org/m2/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.pom
Download https://plugins.gradle.org/m2/org/slf4j/slf4j-parent/1.7.2/slf4j-parent-1.7.2.pom
Download https://plugins.gradle.org/m2/org/ajoberstar/grgit/grgit-core/3.0.0/grgit-core-3.0.0.jar
Download https://plugins.gradle.org/m2/org/ajoberstar/grgit/grgit-gradle/3.0.0/grgit-gradle-3.0.0.jar
Download https://plugins.gradle.org/m2/gradle/plugin/net/minecrell/licenser/0.4.1/licenser-0.4.1.jar
Download https://plugins.gradle.org/m2/com/github/ben-manes/gradle-versions-plugin/0.20.0/gradle-versions-plugin-0.20.0.jar
Download https://plugins.gradle.org/m2/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar
Download https://plugins.gradle.org/m2/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
Download https://plugins.gradle.org/m2/org/codehaus/gpars/gpars/1.2.1/gpars-1.2.1.jar
Download https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/5.1.3.201810200350-r/org.eclipse.jgit-5.1.3.201810200350-r.jar
Download https://plugins.gradle.org/m2/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.jar
Download https://plugins.gradle.org/m2/org/multiverse/multiverse-core/0.7.0/multiverse-core-0.7.0.jar
Download https://plugins.gradle.org/m2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.jar
Download https://plugins.gradle.org/m2/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar
Download https://plugins.gradle.org/m2/org/codehaus/jsr166-mirror/jsr166y/1.7.0/jsr166y-1.7.0.jar
Download https://plugins.gradle.org/m2/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar
Download https://plugins.gradle.org/m2/com/jcraft/jsch/0.1.54/jsch-0.1.54.jar

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Mod\build.gradle' line: 20

* What went wrong:
A problem occurred evaluating root project 'ForgeGradle'.
[QUOTE] Cannot invoke method describe() on null object[/QUOTE]

* 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 1m 39s

C:\Mod>
 
Вот сам build.gradle, где пишет ошибка.

Gradle (Groovy):
plugins {
    id 'net.minecrell.licenser' version '0.4.1'
    id 'org.ajoberstar.grgit' version '3.0.0'
    id 'com.github.ben-manes.versions' version '0.20.0'
  //id 'com.github.johnrengelman.shadow' version '2.0.4'
}

apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
    sourceCompatibility = targetCompatibility = '1.8'
}

group = 'net.minecraftforge.gradle'
version = gitVersion()
def gitVersion() {
    def raw = grgit.describe(longDescr: true, tags: true)
    def desc = (raw == null ? 'unknown-unknown-unknown' : raw).split('-') as List
    def hash = desc.remove(desc.size() - 1)
    def offset = desc.remove(desc.size() - 1)
    def tag = desc.join('-')
    def branch = grgit.branch.current().name   
    return "${tag}.${offset}" //${t -> if (branch != 'master') t << '-' + branch}"
}

sourceSets {
    common
    mcp
    patcher
    userdev
}

configurations {
    all {
        exclude group: 'org.ow2.asm'
    }
    mcpImplementation.extendsFrom commonImplementation
    patcherImplementation.extendsFrom commonImplementation
    userdevImplementation.extendsFrom mcpImplementation
    implementation.extendsFrom mcpImplementation, patcherImplementation, userdevImplementation
}

jar {
    from sourceSets.common.output
    from sourceSets.mcp.output
    from sourceSets.patcher.output
    from sourceSets.userdev.output
}

repositories {
    jcenter()
    maven { url = 'https://files.minecraftforge.net/maven' }
}

license {
    header = file('HEADER')
    ext {
        name = 'ForgeGradle'
        year = 2018
        fullname = 'Forge Development LLC'
    }
    exclude '*[I]/[/I].properties'
    exclude 'net/minecraftforge/gradle/common/diff/'
    exclude 'net/minecraftforge/gradle/common/util/JavaVersionParser.java'
}

wrapper {
    gradleVersion = '4.9'
    distributionType = Wrapper.DistributionType.ALL
}

dependencies {
    commonImplementation gradleApi()
    commonImplementation 'com.cloudbees:diff4j:1.2'
    commonImplementation 'commons-io:commons-io:2.4'
    commonImplementation 'com.github.jponge:lzma-java:1.3' // replaces the LZMA binary
    commonImplementation 'com.nothome:javaxdelta:2.0.1' // GDIFF implementation for BinPatches
    commonImplementation 'com.google.code.gson:gson:2.8.5'
    commonImplementation 'com.google.guava:guava:26.0-jre'
    commonImplementation 'de.siegmar:fastcsv:1.0.2'
    commonImplementation 'net.minecraftforge:artifactural:1.0.+'
    commonImplementation 'org.apache.maven:maven-artifact:3.6.0'
    commonImplementation 'org.apache.httpcomponents:httpclient:4.3.3'

    mcpImplementation sourceSets.common.output
    patcherImplementation sourceSets.mcp.output
    patcherImplementation sourceSets.common.output
    userdevImplementation sourceSets.mcp.output
    userdevImplementation sourceSets.common.output
}

//Gradle doesn't add it's own source when doing the API. So lets hack it in!
import org.gradle.plugins.ide.eclipse.model.*
import org.gradle.plugins.ide.eclipse.model.internal.*
project.extensions.eclipse.classpath.file.whenMerged { Classpath cp ->
    def gradleSrc = gradle.gradleHomeDir.absolutePath.replace(File.separator, '/') + '/src/'
    cp.entries.each { entry ->
        if ((entry in AbstractLibrary) && entry.library.file.name.startsWith('gradle-')) {
            def type = (entry.library.file.name =~ "^gradle(-(.*))?-(${gradle.gradleVersion})")[0][2]
            if (type == 'api') type = 'core-api' //Gradle name is different for cores
            if (type == '') type = 'core'
            entry.sourcePath = new FileReferenceFactory().fromPath(gradleSrc + type)
        }
    }
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }
    repositories {
        maven {
            if (project.hasProperty('forgeMavenPassword')) {
                credentials {
                    username project.properties.forgeMavenUser
                    password project.properties.forgeMavenPassword
                }
                url 'https://files.minecraftforge.net/maven/manage/upload'
            } else {
                url 'file://' + rootProject.file('repo').getAbsolutePath()
            }
        }
    }
}
 

WantaSanchez

Опоздун
633
17
150
Оставь только папку gradle и файл build.gradle
Импортируй градль проект, еклипс должен сам начать билд
Как закончит билд, советую перезапустить еклипс и выполнить таск eclipse.
 
Сверху