SpongeStart Gradle plugin

I would like to know if some other windows users have troubles with the Run-configuration generation. I am trying to understand why this problem is happening (I can’t recreate it sadly enough):

java.nio.file.AccessDeniedException: .idea\runConfigurations\StartForgeServer.xml
	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
	at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.createFile(Files.java:632)
	at com.qixalite.spongestart.tasks.GenerateIntelijTask.generateConfig(GenerateIntelijTask.java:62)
	at com.qixalite.spongestart.tasks.GenerateIntelijTask.doStuff(GenerateIntelijTask.java:36)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Just because I’m interested: What was the problem with the lzma-lib?

Well it wasn’t really a LZMA lib problem. The installer finished, only their was still error output that had to be read. That was causing java to hold the program and basically deadlock the whole thing.
This solved the problem:

Still awkward tho, on linux the program just finishes errors or not.

1 Like

Now it works, thanks!
Working build.gradle file: https://github.com/randombyte-developer/LongMessages/blob/5dbed4b8ef59aae88fd7ee0abc36966b8e632174/build.gradle with kotlin dependencies

I ran the setupServer in the terminal which itself is in IntelliJ. After I closed the terminal, the run configurations updated automatically. I just hit the run button and the server started.

This script is a big help!

1 Like

Sadly, no debug messages are shown. I always have to use info or above. There definitely is the possibility to show the debug messages of plugins but I don’t know how without googling. Would be cool if you add this to the script.

I did some research and I think its a lot of work to make it happen. I would need to unzip the log configuration file for forge and sponge. Change it value’s to debug and overwrite its with vm parameters:
https://github.com/SpongePowered/SpongeForge/blob/master/src/main/resources/log4j2_server.xml

Not sure if their are better ways to change the value.

I thought there were command line parameters for forge like

java -jar forge.jar debug

@thomas15v with the 4.0.0 release there comes the spongegradle plugin. the main extension for that plugin is sponge too. as such your block conflicts with the block provided by spongegradle. I suggest you change your block to spongestart?

1 Like

I changed the block to spongestart now:
https://github.com/Qixalite/SpongeStart/commit/68e3e9996294caae066aedd17b856bba636fb7f7

1 Like

@thomas15v Could you merge this hotfix?
https://github.com/Qixalite/SpongeStart/pull/5

Is it working for IntelliJ IDEA 2016.1?

It should as intellij internals don’t change much

IntelliJ 2016.1 broke Sponge :wink:

https://youtrack.jetbrains.com/issue/IDEA-150685

Spongestart doesn’t use multi-project. So it should work fine.

@liach sorry for the late response, it is merged now.

Oh dear… That’s a big mess

StartServer$SpongeClassLoader.class and StartServer.class are not copied anywhere in project directory tree, they’re just sitting in %USERPROFILE%\.gradle\caches\SpongeStart\start. So, IDEA is complaining: “java.lang.ClassNotFoundException: StartServer”.

They actually should be placed their. The reason IDEA is complaining is because gradle hasn’t been refreshed.

  1. View --> Tool windows --> gradle.
  2. Than press refresh on the gradle panel.

In case you don’t see gradle re-import the project.

What I am doing wrong?

Ah dang… . Yeah IDEA 2016 broke it :frowning: . Just tried it and it looks like it totally ignores the plugin.

It looks like it ignores this line of the plugin:

You could fix it by manually add the start folder as a library. It seems like the new idea doesn’t accept folders from gradle anymore :confused: .

Seems like I will stay a while on 2015 for now lol… (I actually upgraded to 2015 2 weeks ago).

1 Like