jeudi 26 juillet 2018

Classes in test package not available at compile time in IntelliJ

I have a setup like the following:

IntelliJ setup

Where I have two modules: modulea and moduleb, in this case, moduleb has a dependency to modulea defined as:

<dependency>
    <groupId>org.example</groupId>
    <artifactId>module-a</artifactId>
    <version>1.0-SNAPSHOT</version>
    <type>test-jar</type>
</dependency>  

This allows me to use ClassInTestA in ClassInSourceB without any issues while developing:

Using class in test folder in the source folder of another project

However, when I try to build the project, this error prevents IntelliJ to complete the build:

Compilation error

I have come across similar questions in SO:

However, none of the proposed solutions has been able to help my case. I have created an MVCE that is available here as zip and in GitHub.

Aucun commentaire:

Enregistrer un commentaire