Intelli J keep trying download gradle src.zip despite of setting local gradle.

已回答

Hi.

I’m a user which Intelli J 2023.2 Ultimate Edition.

I made a project based on Spring boot and Gradle. 
And I set gradle-wrapper and gradle-6.9.2-bin.zip on local.

My application network environment is closed network. And I'm using nexus for managing dependencies.

For using nexus repositories, I had to set a online mode in Intelli J gradle option.

In this situation, Intelli J keep trying download gradle-6.9.2-src.zip. And I got a error message like below.

"Could not get resource 'https://services.gradle.org/distributions/gradle-6.9.2-src.zip'"

My network is closed, so Intelli J can't access there. This network envrionmet can't be changed.

I don't know why Intelli J try to download gradle-src.zip despite I already download and set gralde-bin.zip in gradle-wrapper.properties.


I tried to change below intelli J option, but it couln't be changed. (It couldn't be saved)

Settings > Build, Execution, Deployment > Build Tools > Gradle: 
Change "Distribution" value to 'Local installation' and I put location value which gralde-bin.zip. But it was not saved.

This problem is not only 2023.2 Ultimate but also 2023.2 Community edition.

Does Anyone know this problem solution? Please help me.

 

0

Hello!

Thank you for reporting this!

If you are looking to use a local install of Gradle you have to point IDEA to the extracted Gradle distribution, i.e. directory that contains "bin", "init.d" and "lib" directories. 

If you are looking to use the Wrapper, check [Your Project Directory] -> gradle -> wrapper -> gradle-wrapper.properties file and update distributionUrl. Alternatively, you can try to put gradle-wrapper.jar to [Your Project Directory] -> gradle -> wrapper (for instance if you have the wrapper in one of your other Projects).

0

Roman Vatagin 

Hi. 
I appreciate your guide. 
But it doesn't work for me.

I tried two ways for solving my problem.

1. Set Local gradle directory 
- I unzip gradle-bin.zip file to my local drive. And I set this on Intelli J gradle Dirtribution. 
ex) Gradle - Distribution: Local installation - D:\gradle
- This directory I unzip has bin, init.d, lib. 
- Dispite of that, Intelli J still try to connect the url("https://services.gradle.org/distributions/gradle-6.9.2-src.zip"), then build fail (becuase running environment is closed network, it can't access the url).

2. Set gradle-wrapper.properties.
- I made a directory named gradle in my project. 
- gradle directory has wrapper.properties.

[directory structure]
gradle
  - wrapper
     - dists
        - gradle-6.9.2-bin.zip
     - gradle-wrapper
        - gradle-wrapper.properties


In gradle-wrapper.properties, I set distributionUrl is dists file like below.

distributionUrl=dists/gradle-6.9.2-bin.zip


Both ways are keep trying to connect gradle src.zip url, then build faile.

For using Nexus repositories, I have to turn off offline togle option at intelli J.

Do I have to check other things for solving this problem?

0

Thank you for the update!

Could you please clarify, as the end goal, are you are looking to use Gradle Wrapper or Local Gradle Install for your Project, so we can focus on one of the options.

Can you please let me know which Gradle DSL (Kotlin or Groovy) your Project uses, as IDEA's behavior may be slightly different depending on the DSL.

Also, please try upgrading to the latest version of IDEA (2023.3.2) as there were changes to Gradle sources downloading.

0

Roman Vatagin 

Thank you for your answer.

 

(1) Clarify I'm looking to use Gradle Wrapper or Local Gradle Install

I don't care which we use "Gradle Wrapper" or "Local gradle installation". But If I could choose both ways, please guide me about using gradle wrapper.

I can choose any setting option if I could build our gradle project on Intellij.
( Build project using ./gradlew build on terminal was succed. But build on Intelli J was failed cause upper issue).

 

(2) Kotlin DSL or Groovy DSL

Now my project uses Kotlin DSL. (setting.gradle.kts, build.gradle.kts)

 

(3) Using 2023.3.2

I can't update 2023.3.2 directly because my project is in the closed network.

I will try use 2023.3.2 version soon. 
If you could give me other guide except version upgrade, please give me it. I will try them before update Intelli J.

 


Thank you for your helping, and I hope you will get good day.

Sincerely. 

0

Roman Vatagin 

And my Intelli J Version information. 

(I copied information from Help → About)

 

————————————————————————————————-

Intelli IDEA 2023.2 (Ultimate Edition)

Build #IU-232.8660.185, built on July 26, 2023

Licensed to Jinhyup Kim

Subscription is active until April 9, 2024.

Runtime version: 17.0.7 + 7 -b1000.6 amd64

VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

Windows 10.0

GC: G1 Young Generation, G1 Old Generation

Memory: 2048M

Cores: 6

Registry:

   ide.experimental.ui=true

 

Non-Bundled Plugins:

   de.netnexus.camelcaseplugin (3.0.12)

   com.vermouthx.idea (1.15.0)

   SVN Disconnect (1.1.1)

   String Manipulation (9.10.0)

   org.jetbrains.plugins.vue (232.8660.205)

 

Kotlin: 232-1.9.0-IJ8660.185

 

 

0

My apologies for the delay in communication, I had to consult the developers on this.

Unfortunately, currently there does not seem to be a way to disable Gradle Sources Download for Projects that use Kotlin DSL.

Could you please let me know if this causes any issue with Project Syncing and/or Building or does it just display the error message? 

0

Hello, I am getting the same error with a Kotlin DSL gradle project.

Interestingly, it doesn't stop me from running ‘assemble’ etc.  Which is good.

0

Hi.
I tried to settting project on Intelli J 2023.4 Ultimate Edition, but I met a same issue. 

I solved this problem use below way in closed network.

(1) Getting dependecy files by command .\gradlew build (terminal build is running well)
(2) Then, Reload Gradle project in IntelliJ Project by offline mode.

I hope this will help who has same issue. And I want to IntelliJ will solve this problem directly soon. 

1

Roman Vatagin 

 

Thank you for keeping follow my issue. 


My IntelliJ couldn’t build project and can’t find any dependency when it can’t be download gradle-src.zip by online mode in closed network. 

I solved this problem by building terminal build, but I think this is not correct way. (Please check my upper comment)

I hope Jetbrains will solve problem directly soon. 
 

0

Jinhyup Kim Thank you for the update!

Technically, sources download is handled by Gradle itself, so there's no much we can do from our end.

Could you please provide more details about the workaround you've mentioned?

Which version of Gradle do you have on your system, is it a complete distribution or binary-only?

0

Roman Vatagin 

 

Thank you for your replying.

I use a "gradle-6.9.2-bin.zip" file. And I set "distributeionUrl=dists/gradle-6.9.2-bin.zip" in gradle-wrapper.properties in my project.

My workaround is below.

First. Run .\gradlew build in my project directory on Terminal (ex: CMD).
Second. And then, Running "reload gradle project" in IntelliJ Gradle window with offline mode.

My environment is closed network, so can't access internet. And Manage gradle dependecy files in Nexus repository running in closed network.  

I think .\gradlew build command is download dependecy files from Nexus, and then offline mode IntelliJ gradle use them saved in caches.

In this situation, I have a question. Is possible Intelli J gradle read gradle-wrapper.properties in project? 
".\graldew build" command read gradle-wrapper.properties and is running well. In my opinion, if Intelli J can read gradle-wrapper.properties and run gradle like .\gradlew, this issue will be solved perfectly. 
(Sadly I don't have many knowledge, so this is just low level curious...)

Thank you again your keep contatcting, and I hope you will have great day.

Sincerely. 

0

Jinhyup Kim  Thank you for sharing the details! We are looking into this!

You can set the Gradle Wrapper to be used by IDEA from Gradle Settings ("Distribution" option), which should account for distributionUrl.

I've suggested this option earlier, but, I believe, it didn't work for you? Could you please confirm?

0

Roman Vatagin 

Dear Sir/Madam. 

I tried to your suggestion of Gradle Settings about “Distributon” option, but it was not working. 

And I found another way. 

 

I solved this by setting gradle version change from gradle-6.9.2-bin.zip to gradle-6.9.2-all.zip in gradle-wrapper.properties.

Also I downloaded gradle-6.9.2-all.zip in directory gradle-6.9.2-bin.zip located.

Then My IntelliJ could success build my project with online mode. 

Despite of IntelliJ needs way more time than normal (it took 2~3 hours for successing build), but It worked well. 

 

Thanks for your keep supporting, and I will share information if I meet another issues. 

 

Thank you again, and Have a good day. 

 

Sincerely. 

0

请先登录再写评论。