Gradle always execute "Creating new in-memory cache for repo 'maven'" , when i build project. i configurated org.gralde.daemon=true in gradle.properties. the command line properties like 'org.gradle.daemon=true' are ignored


(sukenzhu) #1

I upgraded the mac osx version to 10.12, before the upgrade, compile time consuming about 20ms. After the upgrade will be more than 3 minutes

  • 7:58:44.476 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory] Creating new in-memory cache for repo ‘maven’ [bb7841ef7c131efb0be8fa8c0b3c21e7].
  • 17:58:49.500 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientConfigurer] Using Credentials [username: admin] and NTLM Credentials [user: admin, domain: , workstation: ] for authenticating against ‘null:-1’ using NTLM

the ‘creating new in-memory’ always cost several seconds


(Sterling Greene) #2

Hi @sukenzhu,

Could you take a look at the problem described here? Some other projects have been seeing problems with slow localhost resolution on macOS Sierra. https://thoeni.io/post/macos-sierra-java/

Can you try adding your mac’s hostname (mbpro.local below, but this could be different for you) to /etc/hosts?

127.0.0.1   localhost mbpro.local
::1         localhost mbpro.local

If this improves things, I’ll see if there’s something we can do on Gradle’s side to avoid the problem.

Thanks!


(sukenzhu) #3

hi sterling,
I modified the hosts file.Like this:

Then try build twice, It still cost more than 3 minutes.If needed,I can upload the log file


(Sterling Greene) #4

is your hostname actually mbpro.local? It could be different for you.

For example, mine is macbook-2.local. If you run hostname from Terminal, that’s what it should be.


(sukenzhu) #5

thanks sterling, I tried again, now just cost 1 minute. :+1:


(Sterling Greene) #6

Great. I raised an issue to see if there’s anything we can do about it internally.