问题描述
我正在尝试将项目从在线检索(成功)pom 文件转换为在本地查找,但由于执行“重新加载所有 Gradle 项目”,我收到此错误:
A problem occurred configuring root project 'ImageConverter'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.test.gradle.plugins:test-gradle-plugins-common:2.0.1.
Searched in the following locations:
- file:/C:/Users/me/.m2/repository/com/test/gradle/plugins/test-gradle-plugins-common/2.0.1/test-gradle-plugins-common-2.0.1.pom
- file:/C:/Users/me/.m2/repository/com/test/gradle/plugins/test-gradle-plugins-common/2.0.1/test-gradle-plugins-common-2.0.1.jar
required by:
project :
Possible solution:
- Declare repository providing the artifact,see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
这是我在根 build.gradle 中的一个片段:
buildscript {
repositories {
mavenLocal() {
MetadataSources {
mavenPom()
artifact()
}
}
}
dependencies {
classpath 'com.test.gradle.plugins:test-gradle-plugins-common:2.0.1'
}
}
和 .pom 文件(我从以前工作的在线版本逐字复制)开始是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.gradle.plugins</groupId>
<artifactId>test-gradle-plugins-common</artifactId>
<version>2.0.1</version>
我可以从错误消息中复制 .pom 路径,ls
就可以了,因此该文件肯定存在。我做错了什么??
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)