Problem setting up SpongeForge in Eclipse

Hello :slight_smile:

I am trying to setup SpongeForge in Eclipse (2019-03 RC1) using Buildship to get a development environment i can run, debug and hot-swap … worked great in the past :smiley:

I did the following steps to setup my environment:

gradle cleanCache
git clone --recursive https://github.com/SpongePowered/SpongeForge.git
cd SpongeForge
cp scripts/pre-commit .git/hooks
./gradlew setupDecompWorkspace --refresh-dependencies
./gradlew eclipse

So far, all command ran successfully without any error…
I then started Eclipse and imported the SpongeForge project as a Buildship project…
The import succeeds, but (even after Refresh Gradle Project) i am getting this error:

Build path contains duplicate entry: 'C:Users/Blue/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/da76ca59f6a57ee3102f8f9bd9cee742973efa8a/slf4j-api-1.7.25.jar' for project 'testmods'

This is how eclipse looks like:
Unbenannt

Did i forget something?
Someone knows how to resolve this?

Thanks in advance! :slight_smile:

I had a few issues setting it up in eclipse initially. Probably should look into what’s going wrong at some point.
Unless you’re making use of testplugins/testmods you can just remove them from the SpongeForge/SpongeCommon project dependencies (Properties -> Java Build Path)

1 Like

I got it working, thanks! :smile:
I had to find and remove all occurrences of testplugins/testmods in the (super complex) gradle configurations of SpongeForge and SpongeCommon, since i cant just edit the build path if it is imported with Buildship ^^

Okay, i have run into another problem…
When i am trying to run the project in eclipse now, i get this error:

Exception in thread "main" java.lang.AbstractMethodError: org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/Object;ZLjava/net/URI;Ljava/lang/String;)Lorg/apache/logging/log4j/spi/LoggerContext;
	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:618)
	at net.minecraftforge.gradle.GradleStartCommon.<clinit>(GradleStartCommon.java:40)

I think there are some conflicting log4j dependencies. Go through the list of jars in the build path and remove any older versions.

1 Like

You are my hero! :smiley:

I managed to locate the conflicting dependency and changed line 19 in SpongeCommon/gradle/minecraft.gradle from

dependencies {
    testCompile 'org.spongepowered:lwts:1.0.0'
}

to

dependencies {
    testCompile ('org.spongepowered:lwts:1.0.0') {
    	exclude group: 'org.apache.logging.log4j', module: 'log4j-core'
    }
}

With that is is compiling and running fine! \o/

Hey I was having the same exact problem as you and by doing all this stuff I was able to fix my problem as well. I just deleted the testmods and the testplugins folders and then I also removed them from the build path and then removed any instance of them from the build.gradle files in both the spongeforge and spongecommon directories. Now that I’m finally able to boot up minecraft though, it launches all weird and when I try to open it to full screen it just shows me a small screen in the bottom left corner for some reason. I’m not sure if this happened to you but if you or anyone else could help that would be awesome

I am only working on server plugins, so i need only the server and that worked fine. But I just tried to run the client run-configuration and i can confirm that the window is somehow bugged ^^
I have no clue why tho :smiley:

Edit:
However, there is an OpenGL error in the log:

[13:03:34] [main/ERROR]: ########## GL ERROR ##########
[13:03:34] [main/ERROR]: @ Post startup
[13:03:34] [main/ERROR]: 1281: Invalid value