在uploadArchives后面添加一个2,执行gradle build, 遇到错误消息:
A problem occurred evaluating root project ‘quickstart’.
Could not find method uploadArchives2() for arguments [build_a2307i03s3k13jdug3afl2lin$_run_closure5@364def1a] on root project ‘quickstart’ of type org.gradle.api.Project.
把repositories改成repositories2,重新build:
A problem occurred evaluating root project ‘quickstart’.
Could not find method repositories2() for arguments [build_a2307i03s3k13jdug3afl2lin r u n c l o s u r e 5 _run_closure5 runclosure5_closure7@a19504c] on task ‘:uploadArchives’ of type org.gradle.api.tasks.Upload.
这个upload类的位置:C:\MyApp\gradle-6.0\src\plugins\org\gradle\api\tasks
这个repositories标签的实现代码:
public RepositoryHandler repositories(@Nullable Closure configureClosure) {
return ConfigureUtil.configure(configureClosure, getRepositories());
}
同理找到flatDir里dir标签的实现方法,位于类DefaultFlatDirArtifactRepository内。
位置:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":