gpt4 book ai didi

java - 由于 javaml 依赖性失败,无法构建 gradle 项目

转载 作者:行者123 更新时间:2023-12-01 22:56:09 24 4
gpt4 key购买 nike

我有一个在 eclipse 上运行的 gradle Java 项目,它直接使用 Javaml 库,但是每次我尝试在项目的根文件夹中使用 gradle clean build 编译项目时,都会收到以下错误:

 Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find net.sourceforge:javaml:0.1.5.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/net/sourceforge/javaml/0.1.5/javaml-0.1.5.pom
- https://repo.maven.apache.org/maven2/net/sourceforge/javaml/0.1.5/javaml-0.1.5.jar
Required by:
project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

我的 build.Gradle 和依赖项的代码如下:

    plugins {
id 'com.palantir.docker' version '0.22.1'
}
allprojects {apply plugin: 'idea'}
//and standard one
apply plugin: 'java'

repositories {
mavenCentral()
}
docker {
name "hig"
dockerfile file('src/docker/Dockerfile')
copySpec.from(jar).rename(".*","app.jar")
buildArgs(['JAR_FILE' : "app.jar"])
}
dependencies {
//compile project(':shared')
// https://mvnrepository.com/artifact/org.apache.commons/commons-math3
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.0'
// https://mvnrepository.com/artifact/org.ujmp/ujmp-core
compile group: 'org.ujmp', name: 'ujmp-core', version: '0.3.0'
// https://mvnrepository.com/artifact/com.datumbox/lpsolve
compile group: 'com.datumbox', name: 'lpsolve', version: '5.5.2.0'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
// https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.7.2'
// https://mvnrepository.com/artifact/junit/junit
testCompile group: 'junit', name: 'junit', version: '4.4'
// https://mvnrepository.com/artifact/net.sourceforge/javaml
compile group: 'net.sourceforge', name: 'javaml', version: '0.1.5'


}

有谁知道为什么 java ml 依赖项不被识别?注意:我访问了maven存储库网站,但javaml不存在注2:我也未能在本地获取依赖项

最佳答案

在 mvnrepository 页面下有提供者存储库选项卡。添加http://maven.icm.edu.pl/artifactory/repo/构建配置。

repositories {
mavenCentral()
maven {
name "ICM"
url "http://maven.icm.edu.pl/artifactory/repo/"
}
}

关于java - 由于 javaml 依赖性失败,无法构建 gradle 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58438819/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com