5

我在 gradle 中的 Java 项目有问题。我在 gradle 中使用了几个依赖项,其中之一是 jzy3d.api。我已将它包含在 build.gradle 文件中并将 url 添加到存储库中,但它没有找到它。我已经添加了它的存储库,因为它位于此处:http ://maven.jzy3d.org/releases/org/jzy3d/jzy3d-api/1.0.2/ 但是错误消息似乎没有搜索那里。请有人告诉我为什么?这是我的 build.gradle 和错误消息:

plugins {
    id 'java'
    id 'idea'    // optional, for IntelliJ IDEA project
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    maven {
        url "https://maven.jzy3d.org/releases"
    }
    mavenCentral()
}

dependencies {
    testCompile 'org.junit.jupiter:junit-jupiter:5.6.0'
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
    compile group: 'org.jzy3d', name: 'jzy3d-api', version: '1.0.2'
    compile group: 'org.jfree', name: 'jfreechart', version: '1.5.0'
}
Execution failed for task ':BusinessLayer:compileJava'.
> Could not resolve all files for configuration ':BusinessLayer:compileClasspath'.
   > Could not find org.jzy3d:jzy3d-api:1.0.2.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/jzy3d/jzy3d-api/1.0.2/jzy3d-api-1.0.2.pom
     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 :BusinessLayer > project :DataLayer

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

当我向 url 添加一些内容时,例如url "https://maven.jzy3d.org/releases/maven2"错误消息说:

Could not find org.jzy3d:jzy3d-api:1.0.2.
     Searched in the following locations:
       - https://maven.jzy3d.org/releases/maven2/org/jzy3d/jzy3d-api/1.0.2/jzy3d-api-1.0.2.pom
       - https://repo.maven.apache.org/maven2/org/jzy3d/jzy3d-api/1.0.2/jzy3d-api-1.0.2.pom

所以我认为由于某种原因它不想在https://maven.jzy3d.org/releases目录中搜索......

4

0 回答 0