Безымянный модуль читает пакет javax.websocket из обоих - PullRequest
0 голосов
/ 01 ноября 2019

Я получаю сообщение об ошибке, когда мне требуется org.eclipse.jetty.server и импортирует его в мой класс. import org.eclipse.jetty.server.Server;.

Безымянный модуль считывает пакет javax.websocket как из javax.websocket.api, так и из javax.websocket.client.api. Я попытался удалить зависимости в моем pom.xml. Это также не работает.

В моем проекте всего 3 модуля: - seabattleclient - seabattleserver - seabattlelogin

Ниже структура моего проекта: https://imgur.com/a/YMFNbwu

Файл pom.xml с моего сервера

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>SeaBattleStart</artifactId>
        <groupId>nl.fhict.s3</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>seabattleserver</artifactId>
    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>javax-websocket-server-impl</artifactId>
            <version>9.4.15.v20190215</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.5</version>
        </dependency>


    </dependencies>
</project>

Файл pom с моего логина

<?xml version="1.0" encoding="UTF-8"?>
<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>SeaBattleStart</artifactId>
        <groupId>nl.fhict.s3</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>SeaBattleLogin</artifactId>
<dependencies>

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5</version>
    </dependency>


</dependencies>

</project>

Файл pom с моего клиента

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>SeaBattleStart</artifactId>
        <groupId>nl.fhict.s3</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <properties>
        <openfxVersion>11.0.2</openfxVersion>
        <junit-jupiter-api.version>5.3.2</junit-jupiter-api.version>
        <logback-classic.version>1.2.3</logback-classic.version>
    </properties>

    <artifactId>seabattleclient</artifactId>
    <dependencies>
        <!-- (open)Java FX -->
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-base</artifactId>
            <version>${openfxVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>${openfxVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-graphics</artifactId>
            <version>${openfxVersion}</version>
        </dependency>

        <!-- Logback -->
        <!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback-classic.version}</version>
        </dependency>


        <!-- JUnit 5 -->
        <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-jupiter-api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-jupiter-api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>nl.fhict.s3</groupId>
            <artifactId>SeaBattleLogin</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>



    </dependencies></project>

my module-info.java

module seabattleserver {
    requires org.eclipse.jetty.server;
}

Если я уберу требования, я не смогу использовать то, что мне нужно для моего проекта. Поэтому мне нужно другое решение.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...