holmari / gerritstats

Tool for creating statistics from a Gerrit repository
MIT License
195 stars 54 forks source link

Build fails ./gradlew assemble #44

Closed vogella closed 4 years ago

vogella commented 4 years ago

Error message: * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().

kellycampbell commented 4 years ago

I ran into this and found the solution. That's an error from using a newer JDK version. You need to use JDK 8. Looks like it also needs nodejs 8. It fails to build on nodejs 10 or 12 with a compilation failure in libsass due to newer version of v8.

henriquemattos commented 4 years ago

In my case it was missing the path to XCode used by node-gyp, a node module that node-sass depends on. But even though I installed XCode xcode-select --install and set it to use not the command-line but the app with sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer, still I had to manually enter the folder GerritStats and upgrade node-sass to latest to have the latest node-gyp: npm install -y node-sass@latest.

After that I could run ./gradlew assemble successfully. 🍀

ps.: I'm running on macOS Catalina (10.15.3 (19D76))

chrisinmtown commented 4 years ago

So this project is currently limited to being compiled with JDK v8? How bad are the dependencies on v8? Asking differently, what breaks when v10 or (even better) v11 is used?

And the killer question - is the original maintainer @holmari still interested in keeping this alive?

There are a couple of problems right off the bat 1) gradle wrapper is version 4.7, and it cannot run on a modern jdk such as v11. 2) gradle wants the findbugs plugin, but that's not found 3) npm package sass is out of date

This pull request gets the build working: https://github.com/holmari/gerritstats/pull/48/

holmari commented 4 years ago

@chrisinmtown I wrote this tool when working at my previoius company, where we were using Gerrit. I haven't been using Gerrit for over 3 years however, so I haven't maintained this either. If others want to contribute to it, I'd be happy to add a collaborator if there's a volunteer!

chrisinmtown commented 4 years ago

Please test again @vogella . After @holmari merged my PR #48 I can build with the current gradle wrapper in the repo and this java on Mac OSX:

java 11.0.4 2019-07-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

vogella commented 4 years ago

Build works fine with current head. Thank you.

But if I try to run gerrit_stats.sh on a downloaded json I get:

vogella@spike:~/git/gerritstats$ ./gerrit_stats.sh -f gerrit_out/ --branches master Exception in thread "main" java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') at com.holmsted.gerrit.CommandLineParser.(CommandLineParser.java:73) at com.holmsted.gerrit.GerritStatsMain.main(GerritStatsMain.java:19)

vogella commented 4 years ago

The above was with Java 14, with Java 11 I get:

vogella@spike:~/git/gerritstats$ ./gerrit_stats.sh -f gerrit_out/ --branches master Exception in thread "main" java.lang.ClassCastException: jdk.internal.loader.ClassLoaders$AppClassLoader incompatible with java.net.URLClassLoader at com.holmsted.gerrit.CommandLineParser.(CommandLineParser.java:73) at com.holmsted.gerrit.GerritStatsMain.main(GerritStatsMain.java:19)

chrisinmtown commented 4 years ago

@vogella thanks for running a test. I missed that occurrence of CommandLineParser, please see https://github.com/holmari/gerritstats/pull/54

Do you know of an open gerrit I can use for testing? I'm waiting to be granted access to the API on my usual gerrit.

chrisinmtown commented 4 years ago

@vogella please test again, @holmari merged #54

vogella commented 4 years ago

@chrisinmtown sorry, missed your comment. I use the Eclipse Gerrit server for testing.

https://git.eclipse.org/r

To download Gerrits:

./gerrit_downloader.sh --server lvogel@git.eclipse.org/ --project platform/eclipse.platform.ui --project platform/eclipse.platform.swt --project platform/eclipse.platform.text --project platform/eclipse.platform.resources --project platform/eclipse.platform.ua --project platform/eclipse.platform.team -a 2020-02-01 --output-dir gerrit_out/

To create report:

./gerrit_stats.sh -f gerrit_out/ --branches master

You may have to create your own user in Gerrit / Bugzilla (https://bugs.eclipse.org/) and replace lvogel with your new user. Not sure if that works without user.

vogella commented 4 years ago

@chrisinmtown works great, thanks a bunch for your update!

chrisinmtown commented 4 years ago

👍