-
Notifications
You must be signed in to change notification settings - Fork 3
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
Running StartVanillaServer in IntelliJ IDEA fails with gradle 3.2.1 and gradle 3.3. #1
Comments
For easier viewing, the end of the log, where the exception is thrown, is this:
|
Did you refresh gradle in the gradle menu? |
You mean the "Refresh all Gradle projects" button, right? I'm using that one all the time, hoping it will fix something, but to no avail. The "Synchronize 'ProjectName'" item in the Project Navigator doesn't help, either. Also, redoing the "setupServer" task (which is from SpongeStart) doesn't fix the problem for me. Note that StartForgeServer works, it's just StartVanillaServer that doesn't. |
What I think is that the "objectweb" dependency has "compile" scope. What means their are 2 of those available at runtime. Could you verify that all the sponge API dependencies are set to "provided"? Normally my plugin tries to take care of that, but sometimes fails doing so. You should be able to see that in the gradle menu. |
Looks like something is wrong. I be home in 2 hours and than I can take a quick look at it. |
I tried to reproduce this and it works fine for me. My guess is that your gradle version might be outdated, I am using version 2.13. |
Well, it's 3.3 here, so maybe the other way round? I'm using the gradle wrapper version that lives directly inside the project folder. The package that comes with my OS (version 3.2.1, btw) failed on some ready-made (Ubuntu Zesty Zapus here) |
Actually, the gradle package that comes with Zesty Zapus fails on some library mismatch, which is not unexpected, as Zesty hasn't been released yet ;) So what I did now is downgrade the gradle package to 2.13-4 and also the dependent packages which it required an older version for - up to the point that gradle was working again. And I deleted all gradle and maven caches. That resulted in However, IDEA was stubbornly reporting problems now. So I deleted everything except the source code and the gradle scripts. Then I reimported the project. And lo-and-behold, However, I do not want to keep those Yakkety packages on my Zesty install, especially as I would have to pin all of those dependencies (mainly library packages) where the old gradle cannot tolerate a newer version. So I'll go back to gradle 3.3, even if that means I cannot use the On the plus side, I'll clean out the project one more time and reimport it again and we'll see whether some unclean project state might have caused the problem in the first place. |
I tried with gradle wrapper 3.2.1 and 3.3 on a freshly imported project, and both So we can be pretty sure now it's related to the gradle version. And as I'm using the gradle wrapper, I figured that I can just use version 2.13 locally in the project without affecting the rest of my system (of course, I should have thought of that earlier, before doing the Package Fandango), so I will go with that for the time being. |
@blubberdiblub I'll take a look at this in a few hours. Will update when I find something relevant. |
@blubberdiblub @thomas15v As far as I can tell, this isn't a gradle issue. The bug is reproducable using my own code: public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
final Path vanillaPath = Paths.get("").resolve("server.jar");
final Manifest manifest = new JarFile(vanillaPath.toFile()).getManifest();
final SpongeClassLoader loader = new SpongeClassLoader(new URL[]{vanillaPath.toFile().toURI().toURL()}, TestMain.class.getClassLoader());
loader.loadClass(manifest.getMainAttributes().getValue("Main-Class")).getMethod("main", new Class[]{String[].class}).invoke(null, new Object[]{args});
} I'm not sure as of yet why it seems adjusting the Gradle version fixes this issue (according to reports above - I haven't tried myself), as my reproducing this error has nothing to do with Gradle. I will tweak the above until I have a working solution. |
So... I retract my earlier statement. It's most definitely a Gradle issue. However - it's not a problem with SpongeStart, so far as I can tell. The code which is causing the issue (posted above) isn't part of SpongeStart's gradle task. It's entirely separable and can be run as it's own program. http://i.imgur.com/aVTVqDb.png I'm not exactly sure HOW Gradle is interfering, but downgrading does in fact fix the problem. |
I downgraded Gradle to 2.13, refreshed and restarted everything. It still gives me the same error. |
Same error on Gradle 3.5 or 3.6-snapshot. |
Same issue on Gradle 3.4.1 |
Running the Vanilla Sponge from IDEA fails for me whereas running SpongeForge works fine.
The only differences in the run configurations are the working directory (
run/forge
vs.run/vanilla
) and the-scan-classpath
argument, but removing that argument from the StartVanillaServer configuration doesn't help, either.See the attached log output.
The possibly interesting parts of my
build.gradle
are:The text was updated successfully, but these errors were encountered: