Skip to content
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

Gradle 4 upgrade #5949

Merged
merged 7 commits into from
Jul 2, 2017
Merged

Gradle 4 upgrade #5949

merged 7 commits into from
Jul 2, 2017

Conversation

atomfrede
Copy link
Member

@atomfrede atomfrede commented Jun 19, 2017

I fixed some problems with dependency resolution (see comment here: spring-projects/spring-boot#9516) and tested with following settings:

  • SQL, Monolithic Application
  • Gatling Tests
  • Gateway
  • Microservice
  • Mongo
  • Cassandra

I will update the PR when more tests are done,

close #5936

@atomfrede
Copy link
Member Author

@jhipster/developers I have tested all above and couldn't find any problems, so I suggest we can merge it.

@atomfrede atomfrede changed the title WIP: Gradle 4 upgrade Gradle 4 upgrade Jun 28, 2017
@atomfrede
Copy link
Member Author

atomfrede commented Jun 28, 2017

Furthermore when using gradle you can execute a single simulation with -Psimulation=YourSimulation

@jdubois
Copy link
Member

jdubois commented Jun 29, 2017

Congrats!! As there is a lot of advertisement in conferences and Twitter about the new Gradle performance enhancements, did you experience any speed up?

@atomfrede
Copy link
Member Author

Right that's what wanted to try with empty m2 repository as that was most annoying because dependencies have not been downloaded in parallel. Will post some numbers.

@pascalgrimaud
Copy link
Member

@atomfrede :

  • can you rebase with master plz?
  • then, test with gradle+cassandra
  • I think there is an issue, but it's not related to your PR...

Maybe the problem comes from this commit 635a757 and the springfox version 2.7.0

@atomfrede
Copy link
Member Author

atomfrede commented Jun 30, 2017

@pascalgrimaud You are right. It doesn't work. Get this error java.lang.NoClassDefFoundError: com/google/common/util/concurrent/FutureFallback

EDIT: Same problem on master

@pascalgrimaud
Copy link
Member

yes, I saw it there : https://travis-ci.org/hipster-labs/jhipster-travis-build/branches
There is a branch with full builds for Gradle

Not perfected yet and a lot of random failures, specially with uaa, but there are more tests than our current Travis

@atomfrede
Copy link
Member Author

Wow, cool. Will check it and try it locally.

@atomfrede
Copy link
Member Author

I fixed the cassandra problem (missing guava dependency).
Some numbers regarding performance

  • mvn clean package -DskipTests with empty .m2: ~2 Min
  • ./gradlew clean bootRepackage with empty jar cache: ~1 Min
  • mvn clean package -DskipTests with full .m2: ~15 sec
  • ./gradlew clean bootRepackage with full jar cache: ~10 sec (with daemon), ~18 sec (without daemon)

I have no numbers currently for gradle 3.5 but the initial build with empty caches was terrible slow because of non parallel download of dependencies, so for me these are very cool results.

@jdubois
Copy link
Member

jdubois commented Jul 2, 2017

OK, so nothing extraordinary here, but we need to upgrade anyway -> are you confident with merging your PR? If yes, let's do it!

@atomfrede
Copy link
Member Author

Let's Merge it to see if any less used combination doesn't work well. As it also fixes gradle and Cassandra we should Merge it.

@jdubois jdubois merged commit d19bc4f into jhipster:master Jul 2, 2017
@deepu105
Copy link
Member

deepu105 commented Jul 2, 2017

Wow so finally now Gradle is faster than maven. @atomfrede what say we make Gradle the default option?
Most people these days use Gradle anyway

@deepu105
Copy link
Member

deepu105 commented Jul 2, 2017

@jdubois what say we make Gradle the default option?

@sendilkumarn
Copy link
Member

I second it. 👍

@atomfrede
Copy link
Member Author

@deepu105 Would like to have gradle as default, but I think maven is still the dominant build system. E.g. all our services are build with maven. We use gradle for custom things, like executing test with docker or setting up our local minikube environment or handling translations via crowdin. @jdubois How are the current stats maven vs gradle?

@pascalgrimaud
Copy link
Member

I'm a maven user, so I'd prefer keeping maven as default :)
I'm curious to have some stats between maven and gradle too

@deepu105
Copy link
Member

deepu105 commented Jul 3, 2017 via email

@jdubois
Copy link
Member

jdubois commented Jul 3, 2017

Yes stats are always misleading, but as you asked for them, for July 2017, we have:

  • Maven 81,71 %
  • Gradle 18,29 %

Now I don't want to change the build tools for the following reasons:

  • Our current focus is Angular 4, and that's already too complex
  • Gradle 4 just got merged this morning, we need time to see if everything works fine (Docker build? CI-CD?)
  • All my customers (and me also!) use Maven
  • I'm still totally confused when looking at the Gradle conf, after years trying to understand it, when I've never had any trouble with Maven

Then, I'm totally opened at migrating to Gradle in the future:

  • When we have the guarantee everything works well with Gradle
  • If the Grade build is much quicker (but when I mean quicker, I mean "without the Gradle daemon")
  • If this allows us to create some advanced configuration, maybe with the Angular/Webpack builds for example, and that in the end we have something much easier/performant/dev-friendly

@atomfrede
Copy link
Member Author

Totally agree with you, except I don't understand the maven config very well :) But ~20% for a non default option is quite good I think.

@jdubois jdubois modified the milestone: 4.6.0 Jul 6, 2017
@oehme
Copy link

oehme commented Jul 20, 2017

If the Grade build is much quicker (but when I mean quicker, I mean "without the Gradle daemon")

Gradle is designed to trade off the first startup for fast subsequent builds. The daemon is the default for that reason. Running without it only makes sense on throwaway CI machines like Travis. That being said, the only time I've seen Maven being quicker on a "cold" machine was either

  • very small projects where Maven can keep the initial head start (that seems to be the case here)
  • misconfigured Gradle builds

Using clean builds for performance comparisons is missing an important point though - Gradle developers will pretty much never call clean. Gradle has properly working incremental builds.

OK, so nothing extraordinary here

It's 50% faster than Maven for a clean build on a pretty simple project. That's pretty extraordinary, given that in such a small project, there is almost nothing to optimize ;)

I'm not going to advocate for or against changing the default, that should be decided based on your community's feedback. I just wanted to give some perspective on those numbers.

@deepu105
Copy link
Member

Thanks for the clarification @oehme
From your profile looks like you are in the core Gradle team am I right? We would love to have your feedback on the Gradle build we create

@oehme
Copy link

oehme commented Jul 20, 2017

Sure, if you point me to an example of a typical project you create, I'm happy to give some feedback.

@atomfrede
Copy link
Member Author

@oehme I think best way is to test drive https://jhipster.julien-dubois.com/. I have created a simple monolithic application here: https://github.com/atomfrede/jhipsterGradleSampleApplication

If you find things to do better (I am sure you will) that would be awesome!

@deepu105
Copy link
Member

Yes and there is also the official Gradle sample here https://github.com/jhipster/jhipster-sample-app-gradle which should be the same as @atomfrede posted above s it is generated with same version of JHipster

@jdubois
Copy link
Member

jdubois commented Jul 20, 2017

@oehme oh yes, your feedback is very highly welcome here!!!! I can't guarantee we'll switch the default to Gradle, but if performance is much better (and maybe features also?), we'll do our best to market it, and maybe change the stats!

@oehme
Copy link

oehme commented Jul 21, 2017

Just FYI, I'm on vacation next week, so I'll only get around to this in August. I think setting up a hangout would be ideal to walk through some of the pieces.

@deepu105
Copy link
Member

deepu105 commented Jul 21, 2017 via email

@atomfrede
Copy link
Member Author

I am also on vacation next week so august would be fine.

@sendilkumarn
Copy link
Member

Thanks a lot for the clarification @oehme
and ofcourse +1 for hangout.

@deepu105
Copy link
Member

deepu105 commented Aug 6, 2017

@oehme could you let us know a date in August when you would be available for the call you suggested so that I can send out an invitation based on that so that people dont forget :)

@oehme
Copy link

oehme commented Aug 7, 2017

How about the 16th or 17th at 18:00 CEST/ 9:00 PST? From our side @eriwen and I would like to join in.

@atomfrede
Copy link
Member Author

16th is not possible for me as we have jug meetup but no problem if everyone else prefers 16th.

@oehme
Copy link

oehme commented Aug 15, 2017

@deepu105 Wednesday is now already taken for me, but the time slot on Thursday is still free. Can you send out an invite?

@deepu105
Copy link
Member

@oehme yes I'll send an invite. Unfortunately, my 6PM Thursday is taken as well but if @atomfrede and @sendilkumarn are available that should be fine. Guys please confirm

@deepu105
Copy link
Member

@jhipster/developers anyone else interested to join?

@jdubois
Copy link
Member

jdubois commented Aug 15, 2017

I'd love to, but I'm still on holidays (with 3 small kids, so I wonder if that can be called holidays??)

@atomfrede
Copy link
Member Author

I can make it.

@deepu105
Copy link
Member

@atomfrede great. I'll send an invite

@deepu105
Copy link
Member

I have send out a google calendar invite for 17th August 1800 CEST

@oehme
Copy link

oehme commented Aug 17, 2017

@deepu105 There is no hangout attached to the calendar invite, can you please add one?

@atomfrede
Copy link
Member Author

@deepu105 @oehme Should I create a new invite?

@deepu105
Copy link
Member

@atomfrede @oehme @sendilkumarn sorry guys I didnt have access to laptop as I was traveling. Did you manage to make the Hangout? I guess I totally forgot to attach the link. damn me

@atomfrede
Copy link
Member Author

atomfrede commented Aug 17, 2017 via email

@deepu105
Copy link
Member

@atomfrede atomfrede deleted the gradle-4-upgrade branch October 2, 2017 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Gradle 4
7 participants