Build. Gradle dependencies TAB:

If you change dependencies to Dependencies2, the output of Gradle Build receives an error message:

A problem occurred evaluating root project ‘quickstart’.

Could not find method dependencies2() for arguments [build_a2307i03s3k13jdug3afl2lin$_run_closure3@21c69f73] on root project ‘quickstart’ of type org.gradle.api.Project.

Find the org.gradle.api.Project class in the directory org\ gradle.api:

Open project.java to see the description of Dependencies:

A project generally has a number of dependencies it needs in order to do its work. Also, a project generally

  • produces a number of artifacts, which other projects can use. Those dependencies are grouped in configurations, and
  • can be retrieved and uploaded from repositories. You use the {@link org.gradle.api.artifacts.ConfigurationContainer}
  • returned by {@link #getConfigurations()} method to manage the configurations. The {@link
  • org.gradle.api.artifacts.dsl.DependencyHandler} returned by {@link #getDependencies()} method to manage the
  • dependencies. The {@link org.gradle.api.artifacts.dsl.ArtifactHandler} returned by {@link #getArtifacts()} method to
  • manage the artifacts. The {@link org.gradle.api.artifacts.dsl.RepositoryHandler} returned by {@link
  • #getRepositories()} method to manage the repositories.

Project is an interface:

The dependencies method is defined:

Where is the implementation of this method?

Change the name of the implementation TAB in the Dependencies TAB:

Gradle build error:

A problem occurred evaluating root project ‘quickstart’. Could not find method implementation2() for arguments [{group=commons-collections, name=commons-collections, Version = 3.2.2}] on the object of type org. Gradle. API. Internal. Artifacts. DSL. Dependencies. DefaultDependencyHandler.

That Implementation the realization of the TAB is located in the org. Gradle. API. Internal. Artifacts. DSL. Dependencies. DefaultDependencyHandler class.

Group to group2:

Build an error:

A problem occurred evaluating root project ‘quickstart’. Could not set unknown property ‘group2’ for DefaultExternalModuleDependency {group = “null” and name = ‘Commons – collections, version =’ 3.2.2 ‘, The configuration = ‘default’} of type org. Gradle. API. Internal. Artifacts. Dependencies. DefaultExternalModuleDependency.

So build. Gradle file dependencies in the label corresponding to the DefaultExternalModuleDependency instances of the class. The former dependencies attribute group, the name and version corresponding DefaultExternalModuleDependency members of a class:

Dependenies < group > does not exist now:

Gradle build error:

Could not resolve all files for configuration ‘:compileClasspath’ Could not find Commons -collections-: Commons -collections:3.2.2. Searched in the following locations: – repo.maven.apache.org/maven2/comm… If the artifact you are trying to retrieve can be found in the repository but without metadata in ‘Maven POM’ format, You need to adjust the ‘metadataSources {… } ‘of the repository declaration. Required by: project:

From the url of the error message can see gradle build download rely on address: repo.maven.apache.org/maven2/comm…

If the extra – is removed from the URL, it can be accessed normally in the browser:

Repo.maven.apache.org/maven2/comm…

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: