[异常]Gradle:Could not find异常1-分析与解决
问题描述
gradle编译时的Gradle:Could not find *** Searched in the following locations ***
问题重现
- 项目采用gradle进行依赖管理,且项目引用自建依赖仓库nexus上的内部jar包,且检查过nexus确实存在jar包但是编译是出现异常。
- build.gradle文件
dependencies {
compile ('com.wanxuping.test:test:1.0.2.1-SNAPSHOT')
}
- build命令
gradle build
- 现象
Execution failed for task ':com.wanxuping.test.core:compileJava'.
> Could not resolve all files for configuration ':com.wanxuping.test.core:compileClasspath'.
> Could not find com.wanxuping.test-1.0.2.1-SNAPSHOT
Searched in the following locations:
- http://127.0.0.1:8088/nexus/content/groups/public/com/wanxuping/test/1.0.2.1-SNAPSHOT/maven-metadata.xml
- http://127.0.0.1:8088/nexus/content/groups/public/com/wanxuping/test/1.0.2.1-SNAPSHOT/test-1.0.2.1.pom
Required by:
project :com.wanxuping.test.core
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
问题分析
问题:未正确编译
问题解决
解决