gradleintellij-ideabuild.gradleapache-commons-lang

IntelliJ cannot download commons-lang3-3.12.0-sources


I am not seeing any quick documentation on commons-lang. I go into the decompiled .class file and click "Download Sources" and get this:

10:45:40 am: Executing 'ijDownloadSources5e1c23e0-5bf'...


> Task :ijDownloadSources5e1c23e0-5bf FAILED
Execution optimizations have been disabled for task ':ijDownloadSources5e1c23e0-5bf' to ensure correctness due to the following reasons:
  - Type 'IjDownloadTask' property 'collectionProvider' cannot be resolved:  Could not find commons-lang3-3.12.0-sources.jar (org.apache.commons:commons-lang3:3.12.0). Searched in the following locations:  file:/Users/rob.bram/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0-sources.jar. Reason: An input file collection couldn't be resolved, making it impossible to determine task inputs. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#unresolvable_input for more details about this problem.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
1 actionable task: 1 executed

FAILURE: Build failed with an exception.

* Where:
Initialization script '/private/var/folders/58/4bhh_y2955x_rrk219q06r2w0000gp/T/ijDownloadSources8.gradle' line: 36

* What went wrong:
Execution failed for task ':ijDownloadSources5e1c23e0-5bf'.
> Could not resolve all files for configuration ':downloadSources_65dedda4-dd40-4228-8913-a0787c03f670'.
   > Could not find commons-lang3-3.12.0-sources.jar (org.apache.commons:commons-lang3:3.12.0).
     Searched in the following locations:
         file:/Users/rob.bram/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0-sources.jar

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 318ms
10:45:41 am: Execution finished 'ijDownloadSources5e1c23e0-5bf'.

I have this in build.gradle:

apply plugin: 'idea'
idea {
    module {
        excludeDirs += files("node_modules")
        downloadJavadoc = true
        downloadSources = true
    }
}

I do see quick documentation on other APIs. Having trouble figuring out what's wrong with this one.


Solution

  • The normal way to deal with getting hold of dependencies is to add a repository to the build script, and by far the most popular is Maven Central. So add:

    repositories {
        mavenCentral()
    }
    

    and you should be good to go.