我有一个在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/"
}
}