1. 模块代码
module joker{
requires java.xml;
requires spring.boot;
requires spring.boot.autoconfigure;
requires spring.cloud.netflix.eureka.server;
}
2. 启动主程序
@SpringBootApplication
@EnableEurekaServer
public class JokerMain {
public static void main(String[] args) {
SpringApplication.run(JokerMain.class,args);
//new SpringApplicationBuilder(JokerMain.class).run(args);
}
}
3. maven配置
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>learn_cloud_parent</artifactId>
<groupId>com.joker.learn</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>first-ek-server</artifactId>
<dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Edgware.SR4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-eureka-server -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>
</dependencies>
</project>
现在如果添加模块的module-info.java的文件就编译都通过不了,编译错误如上图,下面给出一点
Error:java: 未命名的模块同时从 ribbon.httpclient 和 ribbon.loadbalancer 读取程序包 com.netflix.loadbalancer
Error:java: 未命名的模块同时从 ribbon.core 和 ribbon.loadbalancer 读取程序包 com.netflix.client
Error:java: 未命名的模块同时从 ribbon.core 和 ribbon.httpclient 读取程序包 com.netflix.client.http
Error:java: 未命名的模块同时从 xmlpull 和 xpp3.min 读取程序包 org.xmlpull.v1
Error:java: 模块 spring.context 同时从 xmlpull 和 xpp3.min 读取程序包 org.xmlpull.v1
Error:java: 模块 spring.context 同时从 ribbon.core 和 ribbon.httpclient 读取程序包 com.netflix.client.http
Error:java: 模块 spring.context 同时从 ribbon.httpclient 和 ribbon.loadbalancer 读取程序包 com.netflix.loadbalancer
,对于项目jdk采用的是10,相关配置,全部都对应的修改为jdk10了,别的代码一点没有了,请教如何通过编译,