4

I am trying to write a simple test using Java 11 and TestContainers. However, the compiler is giving following errors.

The module-info.java looks like the following.

module com.oif.reader {

    requires org.junit.jupiter.api;
    requires org.junit.jupiter.engine;
    requires java.instrument;
    requires java.sql;
    requires testcontainers;
}

The test is quite simple. It's very basic at the moment.

package com.oif.reader.integration;

import org.junit.jupiter.api.Test;
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

@Testcontainers
public class GenericTest {

    @Container
    private static final MySQLContainer MY_SQL_CONTAINER = new MySQLContainer();


    @Test
    public void name() {
        String url = MY_SQL_CONTAINER.getJdbcUrl();
        System.out.println(url);
    }
}

Java Compiler gives the following errors.

error: module junit.jupiter reads package org.newsclub.net.unix from both junixsocket.common and junixsocket.native.common

There are about 50 of them similar to this. Any idea on how to fix these issues?

Raedwald
  • 43,666
  • 36
  • 142
  • 227
user451445
  • 367
  • 3
  • 13
  • Here is a similar issue with java 9 modules: https://github.com/testcontainers/testcontainers-java/issues/521 and author wrote that solved problem https://github.com/testcontainers/testcontainers-java/issues/521#issuecomment-368314414 – newOne Sep 11 '19 at 07:34
  • You may also try to get help here https://www.testcontainers.org/getting_help/ – Honza Zidek Sep 11 '19 at 07:40
  • I found a similar issue on stack overflow. Perhaps wasn't aware that this is a split package problem.https://stackoverflow.com/questions/42358084/package-conflicts-with-automatic-modules-in-java-9 – user451445 Sep 11 '19 at 11:56

0 Answers0