Gradle 4 dependency download error with Uiltimate 2020.2
(I'm already aware of a couple of other posts about a similar issue so have tried some of the solutions already, with no luck)
We have a large and complex gradle project that still uses java7 and gradle2 (yes... we know they are out of date and updating this is one of our current tasks)
We can load this project unto Intellij community 2018 and it loads ok, and retrieves any dependent jars it needs via gradle
However, when we try to open the same project in Ultimate 2020.2 the gradle 'sync' task that runs fails on certain jar files but loads others without issue. I can see this because if i delete the the cache folder in my gradle home and restart intellij it obtains many jars but not the one it failed on, so it can clearly get some jars but not others.
Runng a gradle build from the command line (Windows 8.1) with the exact same version of java and gradle downloads these jars without issue and intellij is then happy because it doesnt need to download them again
I've manally set the intellij gradle version to be 4.10.2 (as its about as recent as we can go with java7) within intellij , using JDK1.8.0_221, and have also swittched the intellij IDE itself to the same JDK8 (as per https://intellij-support.jetbrains.com/hc/en-us/articles/206544879)
this is a typical error
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not download poi.jar (org.apache.poi:poi:3.17): Skipped due to earlier error
> Could not download poi.jar (org.apache.poi:poi:3.17): Skipped due to earlier error
For commercial reasons I cannot post either the full log or the build file here but can provide a few extracts
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - IDE: IntelliJ IDEA (build #IU-202.7660.26, 06 Oct 2020 09:32)
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - OS: Windows 8.1 (6.3, amd64)
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - JRE: 1.8.0_221-b11 (Oracle Corporation)
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - JVM: 25.221-b11 (Java HotSpot(TM) 64-Bit Server VM)
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - JVM Args: exit -Xms128m -Xmx1973m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -XX:CICompilerCount=2 -Dsun.io.useCanonPrefixCache=false -Djdk.http.auth.tunneling.disabledSchemes="" -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djdk.attach.allowAttachSelf=true -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Djb.vmOptionsFile=C:\Users\7048171\AppData\Roaming\JetBrains\IntelliJIdea2020.2\idea64.exe.vmoptions -Djava.library.path=C:\Program Files\Java\jdk1.8.0_221\jre\bin;C:\Program Files\Java\jdk1.8.0_221\jre\bin\server -Didea.jre.check=true -Dide.native.launcher=true -Didea.vendor.name=JetBrains -Didea.paths.selector=IntelliJIdea2020.2 -XX:ErrorFile=C:\Users\7048171\java_error_in_idea_%p.log -XX:HeapDumpPath=C:\Users\7048171\java_error_in_idea.hprof
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - ext: C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext: [access-bridge-64.jar, cldrdata.jar, dnsns.jar, jaccess.jar, jfxrt.jar, localedata.jar, meta-index, nashorn.jar, sunec.jar, sunjce_provider.jar, sunmscapi.jar, sunpkcs11.jar, zipfs.jar]
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - library path: C:\Program Files\Java\jdk1.8.0_221\jre\bin;C:\Program Files\Java\jdk1.8.0_221\jre\bin\server
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - boot library path: C:\Program Files\Java\jdk1.8.0_221\jre\bin
2021-01-27 11:11:29,144 [ 15] INFO - #com.intellij.idea.Main - locale=en_GB JNU=Cp1252 file.encoding=Cp1252
and
2021-01-27 11:25:53,364 [ 864235] INFO - System.util.ExternalSystemUtil - External project [C:/NICK/VMG/git-vmg/vmg_development_fundraiser/core] resolution task started
2021-01-27 11:25:53,474 [ 864345] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:\Program Files\Java\jdk1.8.0_221
2021-01-27 11:25:53,474 [ 864345] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:\Program Files\Java\jdk1.8.0_221
2021-01-27 11:25:53,505 [ 864376] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: --debug -Didea.sync.active=true -Didea.resolveSourceSetDependencies=true -Porg.gradle.kotlin.dsl.provider.cid=114407433846345 -Pkotlin.include.android.dependencies=true --init-script C:\Users\7048171\AppData\Local\Temp\ijinit1.gradle
2021-01-27 11:26:07,254 [ 878125] INFO - rationStore.ComponentStoreImpl - Saving appXDebuggerSettings took 15 ms
2021-01-27 11:26:07,270 [ 878141] INFO - rationStore.ComponentStoreImpl - Saving Module: 'core.summary-data-client.api.test'FacetManager took 16 ms
2021-01-27 11:26:07,270 [ 878141] WARN - com.intellij.util.xmlb.Binding - no accessors for org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptInputsWatcher$Storage
2021-01-27 11:26:07,285 [ 878156] INFO - rationStore.ComponentStoreImpl - Saving Project(name=core, containerState=ACTIVE, componentStore=C:\NICK\VMG\git-vmg\vmg_development_fundraiser\core)VcsDirectoryMappings took 15 ms
2021-01-27 11:27:25,603 [ 956474] INFO - .project.GradleProjectResolver - Gradle project resolve error
org.gradle.tooling.BuildActionFailureException: The supplied phased action failed with an exception.
at org.gradle.tooling.internal.consumer.connection.PhasedActionAwareConsumerConnection.run(PhasedActionAwareConsumerConnection.java:58)
Caused by: com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not download poi.jar (org.apache.poi:poi:3.17): Skipped due to earlier error
at org.jetbrains.plugins.gradle.model.ProjectImportAction.addBuildModels(ProjectImportAction.java:258)
What i'm looking for at this stage is anything which will help me debug this a bit more - runnng the task on the IDS with 'debug' or 'stack trace' enabled doesnt give me any more info than the above
Please sign in to leave a comment.
I decided to create a very simple pom with just the apache poi dependecies in it and recreated the same problem.
It turned out that when intellij runs gradle it also downlaods the source jars, however our local maven/gradle mirror doesnt have them and has lost its internet access. I cant fix this at the moment as it needs our sysadmins to reconfigure the proxy settings (which may take some time, dont ask..), so in the short term I want to stop intellj asking gradle to download source jars
In the idea.log it sets -Didea.resolveSourceSetDependencies=true and i cant find out how to override that - I've tried setting it to false in my gradle.properties, Intellij idea.properties and idea64.ex.vmoptions but in very case it keeps passing true to the command line
do
As the error says the root cause is the previous error. What error occurs before this one in log?
>the short term I want to stop intellj asking gradle to download source jars
You can use idea Gradle plugin to configure this:
Thanks Andrey - that worked :)