In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the implementation principle of dependencies tabs in build.gradle". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the implementation principle of the dependencies tab in build.gradle"?
The dependencies tab in build.gradle:
If you change dependencies to dependencies2, the output of gradle build will encounter 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 under the directory org\ gradle\ api:
Open Project.java and view a 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 tag in the dependencies tab randomly:
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 object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Indicates that the implementation of the Implementation tab is located in the org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler class.
Change group to group2:
Build error:
A problem occurred evaluating root project 'quickstart'. Could not set unknown property 'group2' for DefaultExternalModuleDependency {group='null', name='commons-collections', version='3.2.2', configuration='default'} of type org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency.
So the tag in the build.gradle file dependencies corresponds to the instance of the DefaultExternalModuleDependency class. The former dependencies attributes group, name and version correspond to members of the DefaultExternalModuleDependency class:
Then change the value of the group attribute in dependenies slightly to a library file name that does not exist:
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:-https://aven2/commons-collections-/commons-collections/3.2.2/commons-collections-3.2.2.pomhttps://aven2/commons-collections-/commons-collections/3.2.2/commons-collections-3.2.2.pomhttps://aven2/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.pom
At this point, I believe you have a deeper understanding of "what is the implementation principle of the dependencies tab in build.gradle?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.