我在eclipse上导入了一个java项目,其中有build.gradle,如下所示:
plugins {
// Apply the java-library plugin to add support for Java Library
id 'application'
id 'java-library'
id 'eclipse'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'io.vertx:vertx-core:4.2.6'
implementation 'io.vertx:vertx-web:4.2.6'
implementation 'io.vertx:vertx-web-client:4.2.6'
implementation 'io.vertx:vertx-mqtt:4.2.6'
// Use JUnit test framework
testImplementation 'junit:junit:4.13.2'
/* for logging */
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.slf4j:slf4j-jdk14:1.7.36'
}但是eclipse在代码中显示了一个错误“导入io无法解决”:
import io.vertx.core.Vertx;
/*
* Data Service as a vertx event-loop
*/
public class RunService {
public static void main(String[] args) {
Vertx vertx = Vertx.vertx();
DataService service = new DataService(8080);
vertx.deployVerticle(service);
}
}我能做什么?
项目结构:

发布于 2022-08-09 02:36:23
JCenter去年是表示反对并使其只读。今年的新版本,如您试图使用的版本,将永远不会出现在JCenter上。您需要用mavenCentral()替换它。
https://stackoverflow.com/questions/73281648
复制相似问题