Imagine I have two Maven-based projects with Kotlin code, prjA and prjB.
Test class SomeTest in prjA references a class and function defined in prjB:
class SomeTest {
@Test
fun prjACanReferencePrjBStuff() {
val valRes = ValidationResult()
val correctValRes = createCorrectValidationResult()
}
}
When I
- run
mvn clean installin prjB, - update the dependencies of
prjAin IntelliJ Idea and - run
mvn clean installin prjA,
I get errors - Maven can't find the classes defined in prjB:
Why? How can I fix it?
Notes:
- Kotlin classes are publicly visible by default. I don't get any errors during
mvn installofprjB. - The Maven repository contains
prjBartifacts and IntelliJ Idea references the right Maven repository. - When I try to build
prjAfrom the command line, the build succeeds. - Invalidating IntelliJ Idea cache and rebuilding the project doesn't help.
Update 1: I need a solution, which allows me to use prjB not only in tests.
Update 2: Everything works perfectly fine, if I rewrite Kotlin classes in prjB in Java.
